Cache-Control headers, explained for CDN operators

How Cache-Control, s-maxage, no-store and ETags interact with Cloud CDN TTLs, purge and shareable HTML.

Browsers and CDNs both read cache headers, but they are not the same audience. A page that is private for a browser can still be a disaster if the CDN treats it as public. Set headers on purpose, then let Cloud CDN honour or override them with distribution policy.

Public, private and no-store

public means an intermediary may store the response. private means only the browser should. no-store means do not keep a copy. Authenticated HTML should not be public at the CDN.

If your framework sets no-store on everything, the CDN becomes a TLS proxy and you have paid for a cache you never fill.

max-age versus s-maxage

max-age talks to browsers. s-maxage talks to shared caches such as a CDN. Use a long s-maxage on hashed JS, and a shorter one on HTML you intend to purge.

Cloud CDN also lets you set TTLs on the distribution so origin headers are not the only control.

Validators are not a substitute for purge

ETags and Last-Modified help revalidation. They do not push a new HTML shell to 210+ PoPs the moment you deploy. Purge the URL or change the filename.

Versioned assets with a content hash can keep a long TTL forever. The HTML that points at those hashes cannot.

Cookies poison cache keys

If every response Set-Cookies a unique session, and the CDN varies on that cookie, you have built a miss factory. Strip or ignore cookies on paths that are supposed to be public.

Cart and account paths should bypass cache entirely instead of inventing a clever key.

Frequently Asked Questions

Pick one source of truth per path. Many teams let origin headers stand for APIs and set CDN TTLs for static assets.

No. no-cache usually means revalidate before reuse. no-store means do not store. They are easy to mix up and expensive to mix up at the edge.

Not as a public GET-style object. Mutations must reach origin. Cache the subsequent GET if that result is shareable.

Put this on Cloud CDN.

Get started with our Management Console in less than 2 minutes, or connect with an expert to supercharge your business today.