concept Delivery & performance
Browser cache
Learn when a browser can reuse a response, revalidate it, or must fetch it again under HTTP caching rules.
What it means
Browser caching can reuse stored HTTP responses when storage and reuse rules permit. The browser must distinguish a reusable fresh response, a response that needs validation, and one that should not be stored. no-cache and no-store are not synonyms, and browser cache state does not equal DNS cache or a CDN’s shared cache. HTTP caching
The browser's HTTP cache is different from a DNS resolver cache (name-to-address answers) and from a CDN edge cache (shared responses near visitors). Refreshing one layer does not automatically clear another.
Try it
Simulation — replay one browser HTTP cache. Load the synthetic resource, advance time, force validation or change the origin version. The result identifies local reuse, a bodyless 304 or a new 200 response; it does not read or clear your real browser cache.
Replay a browser HTTP cache
Separate local reuse, conditional validation and receipt of a new response body.
private permits storage in this private browser cache but restricts shared caches. no-cache allows storage with validation before reuse; no-store prevents storage of the affected response.
| Item | State / result | Why it matters |
|---|---|---|
| Virtual clock | 0 seconds | No real waiting or network traffic. |
| Origin | v1; ETag "v1" | Changing origin does not rewrite a stored body. |
| Stored representation | None | A 304 is useful only when a corresponding stored representation exists. |
| Stored policy | None | A newly selected origin policy is not retroactive. |
| Next response policy | max-age | Observed only when a request reaches the synthetic origin. |
A synthetic cache only; it neither reads nor clears your actual browser storage.
About this model
One representation, a 60-second freshness lifetime, an optional strong ETag and no Vary or shared cache. At exactly age 60 the entry is stale. Policy controls the next origin response, not an already stored entry. Force validation sends a request even while fresh. Selecting no-store does not alter a stored response. After a network response with no-store, this fixture retains any earlier body only as an ineligible trace, not reusable cache storage. This is not an erasure guarantee for real caches.
Read the article’s primary sources for protocol rules and implementation-specific limits. This scene has no network access.
Load at t=0 to save v1 with a 60-second freshness lifetime. Advance to t=30 and load again: the scene reuses v1 without a network response. Advance to exactly t=60: the entry is stale. With the unchanged ETag, the local conditional exchange returns 304 and uses the stored v1 body. Change the origin version and force validation to receive a new 200 body.
| State before a load | Result in this fixture | Body used |
|---|---|---|
| Saved max-age response, age 30 | Local reuse | Saved representation |
| Age 60, matching ETag | Conditional request and 304 | Saved representation, with updated metadata |
| Origin version changed | New 200 response | Newly received representation |
| Saved no-cache response | Validation before reuse | Depends on the validation result |
| No-store response with no prior entry | No reusable entry is created | Current network response only |
The policy selector describes the next origin response. Merely choosing no-store does not alter an existing entry or cause a fresh cached response to contact the origin. After an actual network response with no-store, this fixture keeps any earlier body only as an ineligible trace; it must not satisfy a later load. That is not proof that a real browser physically erased older copies. The explicit Evict action affects only the synthetic entry.
Private allows storage in this private cache under the other modeled conditions; it is not encryption. No-cache allows storage but requires validation. Reset clears the synthetic entry, origin changes, clock and history. There is one representation, no Vary, no shared cache, no service worker and no network-delay/Age calculation; virtual elapsed time supplies response age. Caching and validation rules 304 semantics
Understand these response controls
| Directive | Practical interpretation |
|---|---|
max-age=60 | Fresh for up to 60 seconds of calculated response age, subject to other rules |
no-cache | A stored response must be validated before reuse; it does not simply mean never store |
no-store | The cache must not store the response; not a full privacy/security guarantee |
private | A shared cache must not store this response; a private cache may under the rules |
s-maxage=300 | Shared-cache freshness can differ from the browser's own max-age |
The Vary field can require selected request-header values to match before a stored response is reused. Other restrictions apply to methods, response codes, authorization and freshness calculations. Cache directives
Diagnose stale content
- Inspect the exact URL and response headers in browser developer tools. The address may differ by query or a redirect.
- Determine whether the browser reports a network transfer, local cache reuse, validation or service-worker handling. A service worker has its own logic and is not synonymous with HTTP cache.
- Compare the response with the CDN or origin only after identifying which layer served it. A browser reload is not a universal cache purge and not a DNS-change test.
- For files that must remain available to already-open pages across deployments, consider versioned/content-hashed asset URLs together with compatible retention. For sensitive personalized responses, review the entire cache policy and shared intermediaries rather than assuming
privatemeans encrypted.
A 304 without a new representation body
A browser has a stored style.css response with an ETag. Once that response needs validation, it can send a conditional request. If the server confirms the representation has not changed, a 304 Not Modified supplies metadata for reuse, rather than a new full CSS body. The browser can still display the page because it combines the validation outcome with its already stored bytes. Compare Cache-Control: no-store, which limits storage, with no-cache, which permits storage but requires validation for reuse. Neither directive should be interpreted as an instant deletion of every previously saved copy. Validation rules HTTP conditions
In practice
When an asset appears stale, inspect the actual response headers, request validators, cache type and effective URL in developer tools. Test a named response rather than clearing unrelated user state or assuming the CDN is responsible. If a sensitive response must not be stored, verify server policy and client behavior; a UI refresh is not proof of correct cache directives.
Key takeaways
Separate storage permission from freshness and validation. A 304 explains why old bytes can still correctly render, while no-store and no-cache address different reuse policies.
Frequently asked questions
Editorial questions, answered from the sources listed for this article.
Why can a 304 response show a complete page?
A validating 304 has no new representation body. The cache updates relevant metadata and reuses the corresponding stored body, subject to the resulting caching rules.
Does no-store erase content already saved by a browser?
It is not an erasure guarantee or a universal purge command. It restricts storage and reuse of the affected response. A previously saved response and a policy change must be considered in their actual request and response context.
Does no-cache mean the browser cannot save data?
No. It generally requires successful validation before reuse rather than prohibiting storage altogether.
Can CDN rules override a browser’s private cache lifetime?
Shared and private caches may use different applicable directives. Inspect the exact response and cache layer instead of assuming one universal lifetime.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- RFC 9111 — HTTP Caching
Sections 3–5. Caching eligibility, validation, freshness and Cache-Control directives.
Checked .
- RFC 9110 — HTTP Semantics
Sections 6, 8, 9 and 15. HTTP messages, methods, representations and status codes.
Checked .
- Cloudflare — Revalidation
Conditional requests and stale revalidation. CDN revalidation behavior is distinct from browser cache behavior.
Checked .