Short answer: no-cache doesn't mean "don't cache". It means "store it, but check with the server before every use". no-store is the one that means "don't keep a copy anywhere". Use no-cache (with an ETag) for pages that must always be current, and no-store for sensitive, per-person responses.
Side by side
| Header | Stored? | Reused without asking the server? |
|---|---|---|
no-store | No | Never: every request downloads it again |
no-cache | Yes | Never: checked every time, usually a quick 304 |
max-age=0 | Yes | Not normally, but a cache may serve it stale, for example when it can't reach your server |
max-age=0, must-revalidate | Yes | Never: if the check fails, the cache returns an error instead |
private, max-age=600 | Only in the browser | Yes, for 10 minutes, in the browser only |
Why no-cache is usually what you want
A no-cache response is kept, and before reusing it the cache asks your server whether it's changed. With a validator, that question is cheap:
HTTP/1.1 200 OK
Cache-Control: no-cache
ETag: "v42"
Next time, the browser sends If-None-Match: "v42". If nothing changed, your server answers 304 Not Modified with no body, and the stored copy is used. Visitors always see the current version, and you only send the full page when it's actually changed.
Without an ETag or Last-Modified, the server can't answer 304, so every check downloads the whole response. That's no-store performance with none of its privacy.
When to use no-store
no-store tells every cache, the browser's included, not to keep a copy at all. Use it for responses that are personal and sensitive: account pages, banking, anything a later user of the same computer shouldn't be able to see.
- Adding
max-ageorno-cachenext to it does nothing:no-storewins. - It's not a security control on its own. It stops caches storing new copies, but anything already stored and any copy someone has saved isn't affected, and it doesn't encrypt anything.
- It can cost you instant back and forward navigation. Browsers have traditionally kept
no-storepages out of their back/forward cache. Chrome now allows it when it's safe (and evicts the page if cookies change), but other browsers may not.
Things that catch people out
Pragma: no-cachein a response does nothing reliable. Pragma is an old HTTP/1.0 request header; its meaning in responses was never defined. UseCache-Control.privateisn'tno-store.privatestops CDNs and proxies storing the response, but the browser may still keep a copy on disk.- CDNs differ. Vercel doesn't cache
no-cacheresponses at all. Cloudflare (on Free, Pro and Business plans) stores them and revalidates every time, as the spec intends. If your CloudFront cache policy's minimum TTL is above 0, CloudFront keeps evenno-cache,no-storeandprivateresponses, and can serve that copy when your origin is unreachable (sendstale-if-error=0to prevent this). - The request header is different. Browsers usually send
Cache-Control: no-cacheon a request when you force a reload. It asks caches not to use a stored copy without checking with the server this time; the fresh response may then replace the stored one. Some CDNs, such as CloudFront, ignore it.
Pick one
| Content | Header |
|---|---|
| HTML that must always be current | Cache-Control: no-cache with an ETag |
| Personal API responses | Cache-Control: private, no-cache |
| Account, payment or medical pages | Cache-Control: no-store |
| Files with a hash in their name | Cache-Control: public, max-age=31536000, immutable |
Paste your headers into the HTTP caching explainer to see what the browser and each CDN will actually do with them, or use the header builder to generate them for your platform.
