Keep cache variants apart
04When a cacheable response can change with Prefer, caches need that field in Vary on both preferred and default responses. A private response is an alternative for preventing shared storage.
The response is delivered to the client. Shared storage stops at a separate gate; a private browser cache may still store it under applicable rules. No no-store or confidentiality guarantee is implied.
Source for this drawing: RFC 8674 · Read RFC section 2 ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
- Vary
- A response field identifying request fields that affect selection of a stored response.
- Private cache
- A cache dedicated to a single user, unlike a shared intermediary cache.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
Separate response variants or prevent shared caching of the varying response.
- RFC 8674 points to RFC 7240 §2: when optional preference application changes cache handling, Vary must identify Prefer even on a response to a request that omitted it. Do not add Vary only to the safer response.
- Vary: Prefer nominates the Prefer request field, not merely the presence of any preference. RFC 9111 §4.1 requires matching nominated values for reuse without revalidation; an absent field matches another absent field.
- Appendix B offers making varying responses uncacheable by shared caches, for example Cache-Control: private. Private permits a private cache under applicable rules; it is not no-store, encryption or an access-control guarantee.
The two public variants are separate eligible GET responses for the same URI. Other storage, freshness and revalidation rules still apply. The private state is an alternative response policy, not an extra cache key and not a promise that all caches erase existing data.
Read the RFC section ↗