All tools

Cache-Control

Who may cache the response and for how long — the header that decides whether your deploy shows up.

request & response
Example
Cache-Control: public, max-age=3600, stale-while-revalidate=60
What it does
Who may cache the response and for how long — the header that decides whether your deploy shows up.
In practice
The values that matter in practice: max-age (seconds the copy is fresh), no-store (never keep it — auth pages, personal data), no-cache (keep it, but revalidate before use — a misleading name), public/private (may a CDN keep it, or only the browser), immutable (never even revalidate — for hashed asset filenames), and stale-while-revalidate (serve the old copy while fetching the new one, which is how sites feel fast AND fresh). The classic incident is a long max-age on a URL whose content changes: the fix is content-hashed filenames for assets and short max-age plus an ETag for HTML.

Works with

← All headers