Tools / Cache policy
Cache-Control checker
Inspect browser and shared-cache response directives, validators, and common Cache-Control conflicts.
More free checks
Run a full security scan or speed test on your site, or try a related tool.
Related free tools
Headers reviewed
Cache-Control, Expires, Pragma, ETag,
Last-Modified, Age, and Vary.
Cache rules should match the content. This check cannot determine whether a response contains private data; do not treat a single generic grade as a substitute for reviewing application behavior.
Why caching is a security question too
Most caching advice is about speed. The reason a security firm ships this tool is the other half: a response cached in the wrong place leaks. If an authenticated page — an account summary, an invoice, a password-reset screen — is stored by a CDN or a corporate proxy, the next person to request that URL can be served someone else's data. The application is working correctly; the cache is the vulnerability.
The single most useful habit is to decide, per response, whether it is specific to one user. If it is, it must never enter a shared cache.
private versus no-store
These are not synonyms and the difference matters:
private— shared caches (CDNs, proxies) must not store it; the user's own browser still may. Right for personalised pages that are harmless on the user's own disk.no-store— nobody stores it anywhere, browser included. Right for genuinely sensitive responses: authentication flows, payment pages, anything containing credentials or tokens.no-cache— the misleading one. It does not mean "do not cache". It means "you may store this, but revalidate with the origin before reusing it." Perfectly reasonable for HTML you want kept fresh, and not a confidentiality control.
If you want nothing retained, no-store is the directive. Reaching for
no-cache because the name sounds right is a common and consequential mix-up.
Vary is how caches tell responses apart
A cache keys on the URL. If the response differs by request header —
Accept-Encoding, Accept-Language, Origin, or worst of
all Cookie or Authorization — the cache needs
Vary to know that. Omit it and one user's variant gets served to another.
In practice, if a response varies by who is logged in, the fix is private or
no-store, not Vary: Cookie. Varying on Cookie is
technically correct and practically useless, because almost every visitor has a different
cookie and the cache hit rate collapses to nothing.
Validators and revalidation
ETag— an opaque version token. The client sends it back inIf-None-Matchand gets304 Not Modifiedif nothing changed. Cheap, and worth knowing that an ETag unique per user is a tracking vector some privacy audits flag.Last-Modified— coarser, one-second resolution, used viaIf-Modified-Since. Fine as a fallback.Age— how long the response has already sat in a cache. A largeAgeon something you believed was dynamic means an intermediary is holding it.stale-while-revalidate— serve the stale copy and refresh in the background. Excellent for perceived speed on content where a few seconds of staleness is harmless.
Conflicts this check looks for
- Long
max-ageon an unversioned asset. Cachingstyle.cssfor a year means you cannot ship a fix — the old copy is pinned until it expires. Fingerprint the filename or add a version query, then cache hard. Expiresdisagreeing withmax-age.Cache-Controlwins in any modern cache, so a contradictoryExpiresis dead weight that misleads whoever reads it next.Pragma: no-cacheas the only control. An HTTP/1.0 request header kept alive by habit. Harmless, but if it is doing the work you thinkCache-Controlis doing, it is not.publicon an authenticated response. The pattern most likely to leak, and the one worth checking by hand.immutablewithout a fingerprinted URL. Tells the browser never to revalidate, which is only safe if the URL changes when the bytes do.
Reading your result
There is no single correct policy. A fingerprinted bundle should be
public, max-age=31536000, immutable; a logged-in dashboard should be
private, no-store; a marketing page sits somewhere between. The check reports
what the headers say and flags combinations that contradict each other — it cannot see
whether the body contains personal data, so a confident-looking grade on an authenticated URL
still needs a human to confirm the response was safe to cache at all.
Related checks: HTTP header checker and cookie security checker. Running a CDN in front of authenticated routes? We test for cache-related exposure as part of an application assessment.
Frequently asked questions
What does Cache-Control: no-cache actually mean?
It does not mean “do not cache”. no-cache lets a browser or CDN store the response but forces it to check with your server before reusing it. To stop a response being stored at all, use no-store.
How long should I cache images, CSS and JavaScript?
If the file name changes whenever the content changes (for example app.3f9a2c.js), cache it for a year with Cache-Control: public, max-age=31536000, immutable. Files whose names never change need a short max-age or revalidation with an ETag.
Why does my CDN keep serving an old version of a page?
The CDN obeys s-maxage (or max-age when that is missing) and keeps its copy until it expires. Purge the URL in the CDN after a deploy, or give HTML a short shared-cache lifetime and version your static files.
Do I still need Pragma and Expires headers?
Rarely. Pragma: no-cache is a leftover from HTTP/1.0, and Expires is ignored whenever Cache-Control: max-age is present. They do no harm, but Cache-Control is the header that matters.