Stale responses and invalidation
06Expiry does not always mean deletion. A state-changing success can require invalidation of a saved answer.
A non-error unsafe-method response triggers target-URI invalidation so later requests do not blindly reuse the old state.
Key idea: Serving stale and invalidating are different decisions.
Rules & examples
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. A disconnected cache MUST return an error rather than reuse it; the status SHOULD be 504 (Gateway Timeout) unless another error status is more applicable.
- After a non-error response to an unsafe method, invalidate the target URI. Other URI invalidation is restricted by same-origin rules.
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.
Sources
New to this? Start hereA quick picture + helpful background
A request starts a conversation.
A client asks for a resource. A server sends a response. The method, address, headers, and status explain what that conversation means.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.