Skip to content

no-cache vs no-store: What Each Cache-Control Directive Actually Does

no-cache stores your response and revalidates it; only no-store refuses to keep a copy. Here is what each Cache-Control directive does in RFC 9111, and where the rules stop applying.

no-cache vs no-store: What Each Cache-Control Directive Actually Does

On this page

You shipped a fix, set Cache-Control: no-cache, and users still saw the old page. That outcome is not a browser bug and not a CDN failure. It is the directive doing exactly what the specification says it does, which is not what its name suggests. The rules come from RFC 9111, "HTTP Caching", published in June 2022, which replaced the older RFC 7234 and is the document every browser and proxy implements today.

Here is the whole answer in four sentences. no-store is the only directive that means do not keep a copy. no-cache means keep a copy but never serve it without asking the origin server first. must-revalidate means you may serve the copy freely while it is fresh, and only once it goes stale must you check. Everything else in this header is a detail hanging off those three ideas.

A cache answers three questions, in order

Every caching rule becomes easier once you see that a cache is not deciding one thing but three, in sequence. First: may I store this response at all? Second: is the copy I stored still fresh, meaning inside the lifetime the response declared? Third: if it is not fresh, may I still hand it over, or must I check with the origin server before reusing it? Directives attach to different questions, and that is the source of nearly every surprise. no-store answers the first question, max-age answers the second, and no-cache and must-revalidate answer the third in different ways.

A cache answers three questions, in order

no-store is the only one that means "do not keep this"

The specification's definition of RFC 9111 is blunt: the no-store response directive indicates that a cache must not store any part of either the immediate request or the response. No copy on disk, no copy in memory, nothing to serve later. This is the directive for a bank statement, an invoice rendered for one signed-in customer, or anything you would not want sitting in a proxy.

The same section adds a caution that is easy to skip and important to read: no-store is not a reliable or sufficient mechanism for ensuring privacy. It is an instruction to well-behaved caches, not an enforcement mechanism, and it says nothing about what happens to the bytes anywhere else along the path. Treat it as hygiene, not as a security control.

no-cache stores the copy and refuses to trust it

The naming here has cost the industry an enormous amount of time. Under RFC 9111, a response marked no-cache must not be used to satisfy another request without forwarding it for validation — which means the copy is stored, it is simply never served cold. Mozilla's documentation states the same point without hedging: no-cache does not mean "don't cache", it allows caches to store a response but requires them to revalidate it before reuse.

Validation is the part that makes this cheap. The cache sends a conditional request carrying the validator it saved, usually an entity tag from the ETag header, and the origin either returns a full new response or replies "304 Not Modified" with no body at all. So a no-cache resource still costs a round trip on every request, but usually not a download. That is the right trade for an HTML document that changes unpredictably and the wrong trade for a 400 KB JavaScript bundle on a mobile connection.

Fresh and stale is the hinge the other directives swing on

A stored response is fresh until its age passes the lifetime it declared, and max-age declares that lifetime in seconds: the response is to be considered stale after its age is greater than the specified number of seconds. While a response is fresh, RFC 9111 allows a cache to satisfy subsequent requests without contacting the origin server at all. That is the entire performance win, and it is why max-age is the directive that actually makes a site fast.

What happens after it goes stale is a separate decision, and the default is stricter than most people assume. The specification says a cache must not generate a stale response unless it is disconnected or has been permitted to by the client or the origin. So a stale copy is not automatically served; something has to allow it. must-revalidate closes even that door — once the response is stale, the cache must not reuse it until it has been successfully validated, and a cache that cannot reach the origin must generate an error response rather than quietly hand over the old copy. If you have ever wondered why one site shows a stale page during an outage and another shows an error, this directive is usually the reason.

The directive that leaks data when you forget it

The private directive controls where a response may live rather than how long. Unqualified, it means a shared cache must not store the response, while the browser's own private cache may. Mozilla's Cache-Control reference, last updated on 17 September 2026, attaches the obvious warning: forget private on a response with personalised content and that response can be stored in a shared cache and reused for multiple users, which is how one customer sees another customer's name at the top of a page. The specification is careful to say the word "private" only controls where the response is stored and cannot ensure the privacy of the content.

The directive that leaks data when you forget it

Where the rules stop applying

Two gaps matter more than any directive. The first is that these rules govern caches, not the browser's history. Mozilla notes that no-cache, must-revalidate and max-age do not guarantee revalidation for history navigation, because the back-forward cache can restore a page without revalidating anything. A user pressing Back is outside the model you just configured.

The second is what happens when you send nothing. A response without a Cache-Control header is not uncached; Mozilla states that cache storage is then allowed to cache it heuristically, meaning the cache picks a lifetime itself, commonly from the Last-Modified date. Silence is a decision, and it is someone else's decision.

There is also a failure mode that comes from trying too hard. Mozilla calls the familiar kitchen-sink value of private, no-cache, no-store, max-age=0, must-revalidate basically meaningless and notes it is equivalent to simply sending no-store. RFC 9111 explains why that is not an accident: when directives conflict, the most restrictive one is honoured, so the extra directives are decoration.

What to set, and when it stops mattering

For a signed-in HTML page, private, no-cache is usually right: one cheap validation request per view, no shared copies. For a build artefact with a hash in its filename, a long max-age is right, because the filename changes when the content does and the old copy can never be wrong. For a document that must never be stored anywhere, no-store alone says it. Almost everything else is a variation on those three.

Before changing a header, check what you are actually sending in a response you believe is broken, and check it from outside your own network, because a CDN in front of your origin may be rewriting it. The directive you set and the directive the browser receives are not always the same string, and that gap explains a surprising share of "the cache ignored me" reports.

Share this post

Muhammad Saleem profile photo

Written by

Muhammad Saleem

I’m Muhammad Saleem, a web developer and the owner of TechWare House, a software house focused on practical web and software solutions. With over 14 years of experience, I’ve built and managed hundreds of websites and custom , PHP/MySQL, Python, Django applications. I share hands-on insights about web development, software, technology, and digital solutions on WizTechnoz.com

166 posts published

All posts by this author

Copy this post

0 Comments

No comments yet. Be the first to share your thoughts.

Join the conversation

Log in or create a free account to leave a comment. You can edit or delete your own comments any time.