Metraipolis › HTTP clauses › rfc9111-s4-c1

RFC 9111 §4 — Constructing Responses from Caches

HTTP Caching · status: INTERNET STANDARD · keyword: MUST NOT · addressee: cache

Official text

When presented with a request, a cache MUST NOT reuse a stored response unless: * the presented target URI (Section 7.1 of [HTTP]) and that of the stored response match, and * the request method associated with the stored response allows it to be used for the presented request, and * request header fields nominated by the stored response (if any) match those presented (see Section 4.1), and * the stored response does not contain the no-cache directive (Section 5.2.2.4), unless it is successfully validated (Section 4.3), and * the stored response is one of the following: - fresh (see Section 4.2), or - allowed to be served stale (see Section 4.2.4), or - successfully validated (see Section 4.3). Note that a cache extension can override any of the requirements listed; see Section 5.2.3. When a stored response is used to satisfy a request without validation, a cache MUST generate an Age header field (Section 5.1), replacing any present in the response with a value equal to the stored response's current_age; see Section 4.2.3. A cache MUST write through requests with methods that are unsafe (Section 9.2.1 of [HTTP]) to the origin server; i.e., a cache is not allowed to generate a reply to such a request before having forwarded the request and having received a corresponding response. Also, note that unsafe requests might invalidate already-stored responses; see Section 4.4. A cache can use a response that is stored or storable to satisfy multiple requests, provided that it is allowed to reuse that response for the requests in question. This enables a cache to "collapse requests" -- or combine multiple incoming requests into a single forward request upon a cache miss -- thereby reducing load on the origin server and network. Note, however, that if the cache cannot use the returned response for some or all of the collapsed requests, it will need to forward the requests in order to satisfy them, potentially introducing additional latency. When more than one suitable response is stored, a cache MUST use the most recent one (as determined by the Date header field). It can also forward the request with "Cache-Control: max-age=0" or "Cache- Control: no-cache" to disambiguate which response to use. A cache without a clock (Section 5.6.7 of [HTTP]) MUST revalidate stored responses upon every use.

Verbatim from the official RFC text, whitespace preserved. Copyright (c) IETF Trust and the persons identified as the document authors; IETF Trust Legal Provisions.

Official source
https://www.rfc-editor.org/rfc/rfc9111.html#section-4-1
Stable URL of this page
https://metraipolis.com/clausola/rfc9111-s4-c1

How to cite

RFC 9111, HTTP Caching, Section 4 (Constructing Responses from Caches), https://www.rfc-editor.org/rfc/rfc9111.html#section-4-1; clause rfc9111-s4-c1: https://metraipolis.com/clausola/rfc9111-s4-c1
BibTeX
@misc{rfc9111s4,
  title = {RFC 9111: HTTP Caching, Section 4},
  howpublished = {RFC Editor},
  url = {https://www.rfc-editor.org/rfc/rfc9111.html#section-4-1},
  note = {Clause rfc9111-s4-c1; https://metraipolis.com/clausola/rfc9111-s4-c1}
}

Summary (ours, not RFC text)

This restriction concerns constructing responses from caches in RFC 9111. Its recorded addressee is cache; use the excerpt and official paragraph to determine the exact obligation.

Conditions

Exceptions

Related clauses