Build a Cache-Control header from what you are serving, with the difference between no-cache and no-store and why immutable needs a hashed filename.
public, max-age=0, must-revalidate
Every token explained below.
Cache-Control: public, max-age=0, must-revalidateimmutable, because a new build produces a new URL.max-age=0, must-revalidate: the browser keeps a copy and checks before using it, so an unchanged page costs a 304 rather than a download.private, or a shared cache may hand one visitor's page to another.Cache-Control is a request to caches, not a guarantee about them. A CDN can be configured to override it, a browser may evict a cached response early for space, and a proxy you do not control may behave differently from the specification. Where the response varies by cookie or header, pair this with a Vary header — without one, a shared cache has no way to know the response was not general.
Cache-Control Builder runs entirely on your device — nothing is fetched or uploaded.
You’re on the Free plan. Compare plans
`no-cache` and `no-store` sound like the same instruction and are not. `no-cache` means store it but revalidate before reuse, so the response is still written to disk. `no-store` means do not store it at all. For a page containing someone's personal data on a shared machine, that distinction is the whole point, and picking the wrong one is the most common Cache-Control mistake.
`immutable` is the one that causes lasting damage. It tells a browser not to revalidate for the whole max-age, even on a reload — so a year-long immutable response on a URL whose contents can change is a stale asset you cannot recall. It is correct only for a filename containing a content hash, where a change produces a new URL. The builder says so where the option is.
`s-maxage` and `stale-while-revalidate` are the levers that matter behind a CDN. `s-maxage` lets you cache for a long time at the edge while keeping browser caching short, which gives you both speed and the ability to purge. `stale-while-revalidate` serves the stale copy and refreshes in the background, so nobody waits for the origin.
The presets cover what people actually serve — a hashed asset, an HTML page, an API response, a private page, an image — and each says what it assumes. The numbers are consequences of those assumptions rather than recommendations floating free of context.
`no-cache` stores the response but revalidates before reusing it. `no-store` does not store it at all. For private data on a shared computer you want no-store; no-cache leaves the response on disk.
Only when the URL contains a content hash, so changed content means a changed URL. Immutable tells browsers not to revalidate even on reload, so on a URL whose contents can change it produces a stale asset you have no way to recall.
Because you can purge a CDN and cannot purge a browser. A long `s-maxage` with a short `max-age` gives you edge caching for speed while keeping the ability to push a change out quickly.
Lets a cache serve the expired copy immediately and fetch a fresh one in the background. Nobody waits for the origin, at the cost of some requests seeing content that is a little old.
Short, and usually revalidated. HTML is what points at your hashed assets, so a long-cached HTML page defeats the hashing entirely — the browser keeps asking for assets that no longer exist.