Web & development / CLEARBYTE

Cache-Control directives: storage and reuse are different

no-cache permits storage but requires successful validation before reuse. no-store instructs caches not to store the response. max-age sets a freshness lifetime; it is not a guarantee that a cache will retain the object for that long.

Cache-Control directives: storage and reuse are different

no-cache permits storage but requires successful validation before reuse. no-store instructs caches not to store the response. max-age sets a freshness lifetime; it is not a guarantee that a cache will retain the object for that long.
Response directiveWhat it controlsExample interpretation
max-age=3600Freshness lifetimeResponse is stale once its current age exceeds 3,600 seconds.
s-maxage=600Shared-cache freshnessShared caches use 600 seconds instead of max-age or Expires.
no-cacheReuse validationStored response must be successfully validated before reuse.
no-storeStorage prohibitionPrivate and shared caches must not store this response.
privateShared-cache storageShared caches must not store the response; a private cache may.
publicShared-cache eligibilityAllows shared caching in cases otherwise restricted; other conditions still apply.
must-revalidateReuse after becoming staleOnce stale, the cache must successfully validate before reuse.
no-transformRepresentation changesIntermediaries must not transform the representation.
Download this reference as CSV ↓

Formula & method

Read the complete response policy and any relevant request directives. Separate permission to store a response from permission to reuse it without contacting the server. Revalidation can return 304 and reuse a stored body; that is different from downloading a fresh body every time.

Choose a policy according to the resource. A content-hashed public asset and an authenticated account page have different correctness and privacy requirements. This reference explains directive semantics rather than prescribing one header for every application. Provider configuration can impose additional caching rules.

Worked example

Cache-Control: public, max-age=0, must-revalidate makes a stored response immediately require validation for reuse. It does not mean “never store,” and it does not provide a one-hour freshness lifetime.

What can change the answer

No-store is not a complete privacy or data-erasure mechanism. Conflicting headers, authorization, status and cache rules can affect the final behaviour.

Sources & definitions

Method checked:

Continue with a related task