Skip to main content

Cache-Control Analyzer & Builder

Explain Cache-Control headers for browsers and CDNs, then build one from TTLs

Input

Paste a Cache-Control value or full response headers.

Results

Paste a header to analyze
Results update as you type. Load an example to see how directives interact.

Directives

No Cache-Control directives found.

What it does

Cache-Control Analyzer & Builder explains how browsers and shared caches such as CDNs treat a response. Paste a Cache-Control value or the full response headers to see the freshness lifetime for each kind of cache, the current age, when revalidation happens, who may store the response, and a list of findings with recommendations. Build mode turns TTLs and options into a header and analyzes the result the same way.

How freshness is calculated

Following RFC 9111, shared caches use s-maxage, then max-age, then Expires minus Date. Browsers use max-age, then Expires minus Date. Without any of these, caches may estimate a heuristic lifetime from Last-Modified; the tool reports that instead of guessing a number. The current age comes from the Age header, and optionally from the time elapsed since the Date header.

Common misunderstandings

no-cache does not mean do not store: it means store, but revalidate before every reuse. Only no-store prevents storage. private keeps a response out of shared caches but not out of the browser cache. s-maxage overrides max-age only in shared caches. must-revalidate forbids serving a stale response, which also disables stale-while-revalidate and stale-if-error in most caches.

Parsing rules

Directive names are case-insensitive and separated by commas; quoted values such as private="Set-Cookie" may contain commas. Duplicate directives are flagged and the first occurrence is used. Invalid numbers such as max-age=abc are errors and make the response stale. Unknown extensions are listed as info, and likely typos such as maxage get a suggestion.

Privacy

Parsing and analysis run in your browser. Pasted headers are not saved or sent anywhere; only the selected mode and the Date option are remembered on this device. Cookie values in pasted headers are never displayed in the results.

Frequently asked questions
What is the difference between no-cache and no-store?
no-cache lets browsers and shared caches store the response but requires them to revalidate it with the origin before every reuse, which is cheap when the response has an ETag or Last-Modified. no-store forbids storing the response at all, so every request downloads it again.
Does s-maxage affect the browser cache?
No. s-maxage applies only to shared caches such as CDNs and proxies, where it overrides max-age and Expires and also implies proxy-revalidate. Browsers ignore it and use max-age, or Expires minus Date when max-age is missing.
Are pasted headers sent to a server?
No. Parsing, analysis and the builder run entirely in your browser. Pasted headers are not saved or sent anywhere, and cookie values from Set-Cookie lines are never shown in the results or the Markdown report.

CodingTool is officially live on