Tools / Cache policy

Cache-Control checker

Inspect browser and shared-cache response directives, validators, and common Cache-Control conflicts.

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:

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

Conflicts this check looks for

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.