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

Store and select a response

01

A cache first decides whether storage is permitted, then whether a stored response matches a later request.

Related RFCs and changes

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

DIAGRAM§ 3 ↗
RFC 9111 · § 3EXAMPLE
3 / 3
Store and select a responseAn eligible origin response is stored with a URI and Vary metadata; a later request chooses the JSON variant instead of the HTML variant.Storage and selection are separate decisionsIllustrative cacheable GET /guide responseOrigin response200 OK · Cache-Control: max-age=60Vary: AcceptStored variant keyGET /guide · Accept: application/jsonGET /guide · Accept: text/htmlMatch method, target URI, and Vary inputsChoose the matching representation for this request
03
Choose the matching stored variant.

A JSON-preferring request must not accidentally receive a variant selected for HTML.

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

A stored answer still needs a valid reuse decision.

  • Storage requires the understood method and applicable status, directive, and authentication conditions in §3.
  • The primary cache key includes method and target URI; common GET caches often key primarily by URI.
  • Vary requires comparing the nominated request fields before selecting a stored variant. Vary: * never matches without validation.
DETAILS

A cache can decline to store an otherwise cacheable response. Partial and authenticated responses have additional rules. The diagram shows an eligible ordinary GET response.

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 ↗