Visual RFC.
ALL RFCs / RFC 9111
Read the RFC ↗
RFC 9111 / CACHE POLICY

Stale responses and invalidation

06

Expiry does not always mean deletion. A state-changing success can require invalidation of a saved answer.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

RFC 9111 · § 4.2.4EXAMPLE
3 / 3
Stale responses and invalidationAn expired response needs validation under must-revalidate; a separate successful unsafe PUT invalidates the target cache entry.Expiry and invalidation are different eventsIllustrative /profile cache entryStored /profile · age 90 · lifetime 60STALEmust-revalidate: validate before reuseconditional requestCannot validate? Do not serve this stale entrySeparate event: PUT /profile → 204Invalidate target entry: remove or require validationA successful unsafe request invalidates its target URI
03
Invalidate the changed target.

A non-error unsafe-method response triggers target-URI invalidation so later requests do not blindly reuse the old state.

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
KEY POINT

Serving stale and invalidating are different decisions.

  • A stale response needs a permitted circumstance such as disconnection or explicit permission, and must not violate a prohibiting directive.
  • must-revalidate forbids reuse of a stale response without successful validation; if validation cannot be done, a 504 response is required.
  • After a non-error response to an unsafe method, invalidate the target URI. Other URI invalidation is restricted by same-origin rules.
DETAILS

Invalidation means removing the saved entry or marking it invalid so validation is required, rather than guaranteeing every copy on the Internet was erased. RFC 5861 defines additional stale-response permissions.

Read the RFC section ↗

Diagrams simplify the RFC. Read the linked sections for complete requirements.

Privacy
All chapters in this RFC
  1. Store and select a response
  2. Freshness and age
  3. Revalidate with 304
  4. Cache-Control directives
  5. Private and shared caches
  6. Stale responses and invalidation
RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗