Skip to content
WebsiteHosting.com

concept Delivery & performance

Browser cache

Learn when a browser can reuse a response, revalidate it, or must fetch it again under HTTP caching rules.

Sources checked · P0026

What it means

A browser cache can keep a previously received HTTP response and reuse it when the HTTP caching rules permit. The response has a freshness lifetime, may need validation with the origin, or may be ineligible for storage. Reuse is conditional; it is not a promise that a browser will store every resource. HTTP caching standard

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.

Simulation
Empty synthetic browser cache

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.

Replay a browser HTTP cache: current state
ItemState / resultWhy it matters
Virtual clock0 secondsNo real waiting or network traffic.
Originv1; ETag "v1"Changing origin does not rewrite a stored body.
Stored representationNoneA 304 is useful only when a corresponding stored representation exists.
Stored policyNoneA newly selected origin policy is not retroactive.
Next response policymax-ageObserved only when a request reaches the synthetic origin.
Replay a browser HTTP cache: local inputs and actions

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 loadResult in this fixtureBody used
Saved max-age response, age 30Local reuseSaved representation
Age 60, matching ETagConditional request and 304Saved representation, with updated metadata
Origin version changedNew 200 responseNewly received representation
Saved no-cache responseValidation before reuseDepends on the validation result
No-store response with no prior entryNo reusable entry is createdCurrent 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

DirectivePractical interpretation
max-age=60Fresh for up to 60 seconds of calculated response age, subject to other rules
no-cacheA stored response must be validated before reuse; it does not simply mean never store
no-storeThe cache must not store the response; not a full privacy/security guarantee
privateA shared cache must not store this response; a private cache may under the rules
s-maxage=300Shared-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

  1. Inspect the exact URL and response headers in browser developer tools. The address may differ by query or a redirect.
  2. 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.
  3. 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.
  4. 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 private means encrypted.

In practice

Use freshness for stable resources, validators for resources that may change, and a deliberate policy for personalized data. Compare with CDN for shared edge behavior and DNS TTL for an entirely different cache lifetime. If a real page is missing, HTTP 404 troubleshooting helps separate missing routes from stale content.

Key takeaways

Ask three separate questions: may the response be stored, may it be reused now, and must it be validated? A 304 needs a corresponding stored body; it is not an empty replacement page. No-cache is not no-store, and changing a server policy is not a universal cache-deletion command.

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.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. RFC 9111 — HTTP Caching

    Sections 3–5. Caching eligibility, validation, freshness and Cache-Control directives.

    Checked .

  2. RFC 9110 — HTTP Semantics

    Sections 6, 8, 9 and 15. HTTP messages, methods, representations and status codes.

    Checked .

  3. Cloudflare — Revalidation

    Conditional requests and stale revalidation. CDN revalidation behavior is distinct from browser cache behavior.

    Checked .