How to use this Cache-Control generator
Pick a scope, enter the second values and tick the directives you want, and a ready-to-paste Cache-Control line appears. A blank second field omits that directive. The tool also shows browser and shared-cache freshness, the upper bound on how long a stale response can be served, and where the directives conflict.
How the output is derived
Directive names and precedence follow the HTTP Caching standard (RFC 9111), and stale-while-revalidate follows RFC 5861, both checked October 2026. The stale exposure bound is the freshness lifetime plus stale-while-revalidate, and it is not added when must-revalidate is present. There is no authoritative recommended lifetime, so all second values stay inputs.
Limits and cautions
Other headers such as ETag, Vary and Age, and CDN-specific extension directives, are out of scope. The conditional request flow belongs to the ETag strategy tool. The generated header carries no thousands separators, so it pastes straight into a config.
Frequently asked questions
no-cache allows storing but revalidates with the origin before each reuse. no-store forbids storing at all. To switch caching off, use no-store.
Yes. Shared caches read s-maxage while browsers read max-age, which is how a CDN is kept long while the browser copy stays short.
It only suppresses revalidation inside a freshness lifetime, so with no max-age there is no window for it to apply. It pairs with hashed file names.