Caches & revalidation
09A cache can reuse a prior response when allowed. Stale entries can sometimes be validated without retransmitting content.
The cache applies RFC 9111 rules to update and reuse its stored response.
Key idea: Distinguish reuse policy from validation.
Terms
- Client / user agent
- The app making a request; in this example, your browser.
- Origin server
- The server responsible for providing an answer for the target resource.
- Request
- A message asking for an action on a resource.
- Response
- The server’s message reporting the result of a request.
- Resource
- Something identified by a URI, such as the page at /story.
- Representation
- Content and descriptive information that convey a resource’s state, such as an HTML page.
- Semantics
- What a message or protocol element means, independently of how it travels.
- Cache
- A store of responses that can be reused when applicable rules permit.
- Freshness
- Whether a stored response can be reused without checking with the origin.
- Revalidation
- Check whether stored content is still suitable for reuse.
- Stale
- A stored response that is no longer fresh; reuse depends on applicable cache rules.
Rules & examples
Distinguish reuse policy from validation.
- HTTP caching stores responses for future equivalent requests.
- Method semantics and response status affect whether a response is cacheable.
- RFC 9111 supplies the detailed freshness, storage, and reuse rules; RFC 9110 defines the associated semantics and conditional requests.
This chapter illustrates the interface with caching. It does not imply every GET is cacheable, or that a cache may reuse any stored response without checking policy.
Predict: Does saving a response mean a cache may reuse it forever?
Check your answer
No. Storage, freshness and validation rules determine whether reuse is allowed.
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.