Cache Header Analyzer
Read a URL's caching headers and say plainly what browsers and proxies will do with them.
About this tool
Reads `Cache-Control`, `Expires`, `ETag`, `Last-Modified` and `Vary`, and explains what a browser and a shared cache will each actually do.
Caching goes wrong in two directions, and both cost something.
**Too short** and every visitor downloads assets that have not changed since last year. That is the common case, and it is usually a server default nobody revisited.
**Too long on an HTML document** and people see yesterday's page with no way to force a refresh. A `max-age` of a year on a page is not a performance win; it is a bug that takes a year to expire, and there is no way to recall it.
The question that decides which applies is whether the URL changes when the content does. A fingerprinted asset — `app.4f2a1c.js` — can be cached forever safely, because a new version is a new URL. An HTML document at a stable URL cannot be, and treating the two the same is the mistake worth catching.
Common questions
What should an HTML page use?
Something short, or no-cache with an ETag. A page at a stable URL that is cached for hours is a page that shows stale content to returning visitors, and nothing you can do afterwards clears it from their browser.
What should CSS and JavaScript use?
max-age=31536000, immutable — but only if the filename contains a content hash. Without one you cannot ship a change, because every returning visitor keeps the old file for a year.
What is the difference between no-cache and no-store?
no-cache allows storing but requires revalidation before reuse, so an unchanged resource still costs only a 304. no-store forbids storing at all, and is for genuinely sensitive responses. They are routinely confused, and no-store is much more expensive.
Why does Vary matter?
It tells shared caches which request headers change the response. Vary: User-Agent effectively disables shared caching, because there are thousands of distinct user agents and each becomes a separate cache entry.