A global HTTP(S) load balancer fronts an API that sets Set-Cookie headers but returns identical content for all users. To allow Cloud CDN to cache responses for that API endpoint, what change is the most appropriate?
Choose an answer
Tap an option to check your answer.
Correct answer: Stop sending Set-Cookie from the backend and return Cache-Control: public, max-age.
Why this is the answer
The most appropriate change is to stop sending Set-Cookie headers and return Cache-Control: public, max-age. Cloud CDN, by default, does not cache responses that include Set-Cookie headers because cookies typically indicate user-specific content, which is not cacheable. Since the API returns identical content for all users, cookies are unnecessary. Adding Cache-Control: public, max-age explicitly tells CDN that the content is cacheable and for how long. Enabling the "Ignore-Cookies" option is not ideal because the presence of Set-Cookie headers still adds unnecessary overhead. Moving the API behind an internal load balancer is irrelevant as Cloud CDN works with external HTTP(S) load balancers. Cloud DNS latency-based steering optimizes routing but doesn't address the caching issue caused by Set-Cookie headers.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed