HTTP Cache Groups
Extracted elements (18)
Cache group membership is determined by string equality (case-sensitive) rather than URL structure or other resource relationships, providing a dedicated mechanism for expressing relationships that is independent of URL design choices.
Cache groups operate within a single cache and only across stored responses from the same origin server. The mechanism intentionally does not address synchronisation between multiple caches or association of responses from different origins.
Group strings are opaque to caches — the cache has no insight into their structure or content beyond using them to uniquely identify a group. This avoids requiring the cache to parse or interpret application-level semantics.
Grouped invalidation explicitly does not cascade: invalidating a group member does not trigger further group invalidations. This prevents potentially unbounded or unintended invalidation chains.
In addition to invalidation, group relationships can be used by caches to optimize operation such as informing cache eviction algorithms, making grouping useful beyond just explicit invalidation events.
Cache extensions can explicitly strengthen the MAY requirement for Cache-Group-Invalidation into a required obligation for caches that process those extensions, allowing targeted cache control to mandate invalidation.
Cache extensions (e.g., targeted cache control header fields per RFC 9213) can explicitly strengthen the MAY requirement for grouped invalidation into a stronger obligation for caches that process those extensions.
A cache that invalidates a stored response MAY invalidate any stored responses that share groups with that response. Grouped invalidations do not cascade — further grouped invalidations are not triggered by a grouped invalidation.
A cache that receives a Cache-Group-Invalidation header field on a response to an unsafe request MAY invalidate any stored responses sharing groups with any of the listed groups.
Group membership requires matching the same URI origin (per HTTP Section 4.3.1) in addition to matching the Cache-Groups string. Responses from different origins cannot share a group.
Implementations MUST support at least 32 groups in a Cache-Group-Invalidation field value, with up to at least 32 characters in each member.
The Cache-Group-Invalidation header field MUST be ignored on responses to requests that have a safe method (e.g., GET). Only unsafe request responses may carry meaningful Cache-Group-Invalidation signals.
The Cache-Group-Invalidation response header field is a List of Strings (Structured Fields). Each member identifies a group that the response invalidates, allowing a state-changing response to trigger invalidation of related cache groups.
The Cache-Groups response header field is a List of Strings (per Structured Fields). Each member identifies a group that the response belongs to. These strings are opaque to the cache and used solely to identify group membership.
Two stored responses belong to the same group when they both contain a Cache-Groups field with the same String (case-sensitive, character-by-character comparison) and both share the same URI origin.
IANA has added two permanent entries to the HTTP Field Name Registry: 'Cache-Groups' and 'Cache-Group-Invalidation', both referencing RFC 9875.
This mechanism allows resources sharing an origin to invalidate each other. In shared hosting environments where one origin represents multiple parties, one party could group its resources with another party's resources or send Cache-Group-Invalidation signals that have side effects on them. Shared hosts can mitigate this by controlling access to these header fields.
Both Cache-Groups and Cache-Group-Invalidation are encoded as Structured Fields List of Strings. The ordering of members is not significant, and unrecognised Parameters are to be ignored.