🧺Cache-Control Header Generator

Assemble directives, bound staleness

s
s
s

Directives to include

Cache typeFreshnessAfter expiry

Directive names and meanings follow the HTTP Caching standard (RFC 9111) and the stale-while-revalidate extension (RFC 5861), checked October 2026. There is no authoritative recommended cache lifetime, so every second value stays a user input. The generated header carries no thousands separators.

You Might Also Need

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

How do no-cache and no-store differ?

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.

Can max-age and s-maxage be sent together?

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.

Why does immutable seem to do nothing?

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.