| draft-ietf-httpbis-cache-groups-02.txt | draft-ietf-httpbis-cache-groups-latest.txt | |||
|---|---|---|---|---|
| Network Working Group M. Nottingham | HTTP Working Group M. Nottingham | |||
| Internet-Draft June 17, 2024 | Internet-Draft Cloudflare | |||
| Intended status: Standards Track | Intended status: Standards Track October 23, 2025 | |||
| Expires: December 19, 2024 | Expires: April 26, 2026 | |||
| HTTP Cache Groups | HTTP Cache Groups | |||
| draft-ietf-httpbis-cache-groups-02 | draft-ietf-httpbis-cache-groups-latest | |||
| Abstract | Abstract | |||
| This specification introduces a means of describing the relationships | This specification introduces a means of describing the relationships | |||
| between stored responses in HTTP caches, "grouping" them by | between stored responses in HTTP caches, grouping them by associating | |||
| associating a stored response with one or more opaque strings. | a stored response with one or more strings. | |||
| About This Document | About This Document | |||
| This note is to be removed before publishing as an RFC. | This note is to be removed before publishing as an RFC. | |||
| Status information for this document may be found at | Status information for this document may be found at | |||
| <https://datatracker.ietf.org/doc/draft-ietf-httpbis-cache-groups/>. | <https://datatracker.ietf.org/doc/draft-ietf-httpbis-cache-groups/>. | |||
| Discussion of this document takes place on the HTTP Working Group | Discussion of this document takes place on the HTTP Working Group | |||
| mailing list (<mailto:ietf-http-wg@w3.org>), which is archived at | mailing list (<mailto:ietf-http-wg@w3.org>), which is archived at | |||
| skipping to change at page 1, line 47 ¶ | skipping to change at page 1, line 47 ¶ | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on December 19, 2024. | This Internet-Draft will expire on April 26, 2026. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2024 IETF Trust and the persons identified as the | Copyright (c) 2025 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| carefully, as they describe your rights and restrictions with respect | carefully, as they describe your rights and restrictions with respect | |||
| to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
| include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
| the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
| skipping to change at page 2, line 31 ¶ | skipping to change at page 2, line 31 ¶ | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | |||
| 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 | 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 | |||
| 2. The Cache-Groups Response Header Field . . . . . . . . . . . 3 | 2. The Cache-Groups Response Header Field . . . . . . . . . . . 3 | |||
| 2.1. Identifying Grouped Responses . . . . . . . . . . . . . . 4 | 2.1. Identifying Grouped Responses . . . . . . . . . . . . . . 4 | |||
| 2.2. Cache Behaviour . . . . . . . . . . . . . . . . . . . . . 4 | 2.2. Cache Behaviour . . . . . . . . . . . . . . . . . . . . . 4 | |||
| 2.2.1. Invalidation . . . . . . . . . . . . . . . . . . . . 4 | 2.2.1. Invalidation . . . . . . . . . . . . . . . . . . . . 4 | |||
| 3. The Cache-Group-Invalidation Response Header Field . . . . . 4 | 3. The Cache-Group-Invalidation Response Header Field . . . . . 4 | |||
| 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 | 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 | |||
| 4.1. HTTP Field Names . . . . . . . . . . . . . . . . . . . . 5 | 4.1. HTTP Field Names . . . . . . . . . . . . . . . . . . . . 5 | |||
| 5. Security Considerations . . . . . . . . . . . . . . . . . . . 5 | 5. Security Considerations . . . . . . . . . . . . . . . . . . . 6 | |||
| 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 | 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 | |||
| 6.1. Normative References . . . . . . . . . . . . . . . . . . 6 | 6.1. Normative References . . . . . . . . . . . . . . . . . . 6 | |||
| 6.2. Informative References . . . . . . . . . . . . . . . . . 6 | 6.2. Informative References . . . . . . . . . . . . . . . . . 6 | |||
| Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 6 | Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 7 | |||
| Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7 | Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 7 | |||
| 1. Introduction | 1. Introduction | |||
| HTTP caching [HTTP-CACHING] operates at the granularity of a single | HTTP caching [HTTP-CACHING] operates at the granularity of a single | |||
| resource; the freshness of one stored response does not affect that | resource; the freshness of one stored response does not affect that | |||
| of others. This granularity can make caching more efficient -- for | of others. This granularity can make caching more efficient -- for | |||
| example, when a page is composed of many assets that have different | example, when a page is composed of many assets that have different | |||
| requirements for caching. | requirements for caching. | |||
| skipping to change at page 3, line 9 ¶ | skipping to change at page 3, line 9 ¶ | |||
| For example, it is often necessary to invalidate a set of related | For example, it is often necessary to invalidate a set of related | |||
| resources. This might be because a state-changing request has side | resources. This might be because a state-changing request has side | |||
| effects on other resources, or it might be purely for administrative | effects on other resources, or it might be purely for administrative | |||
| convenience (e.g., "invalidate this part of the site"). Grouping | convenience (e.g., "invalidate this part of the site"). Grouping | |||
| responses together provides a dedicated way to express these | responses together provides a dedicated way to express these | |||
| relationships, instead of relying on things like URL structure. | relationships, instead of relying on things like URL structure. | |||
| In addition to sharing invalidation events, the relationships | In addition to sharing invalidation events, the relationships | |||
| indicated by grouping can also be used by caches to optimise their | indicated by grouping can also be used by caches to optimise their | |||
| operation; for example, it could be used to inform the operation of | operation (e.g., to inform the operation of cache eviction | |||
| cache eviction algorithms. | algorithms). | |||
| Section 2 introduces a means of describing the relationships between | Section 2 introduces a means of describing the relationships between | |||
| a set of stored responses in HTTP caches by associating them with one | stored responses in HTTP caches, by associating those responses with | |||
| or more opaque strings. It also describes how caches can use that | one or more groups that reflect those relationships. It also | |||
| information to apply invalidation events to members of a group. | describes how caches can use that information to apply invalidation | |||
| events to members of a group. | ||||
| Section 3 introduces one new source of such events: a HTTP response | Section 3 introduces one new source of such events: a HTTP response | |||
| header that allows a state-changing response to trigger a group | header field that allows a state-changing response to trigger a group | |||
| invalidation. | invalidation. | |||
| These mechanisms operate within a single cache, across the stored | These mechanisms operate within a single cache, across the stored | |||
| responses associated with a single origin server. They do not | responses associated with a single origin server (see Section 2.1). | |||
| address this issues of synchronising state between multiple caches | They do not address the issues of synchronising state between | |||
| (e.g., in a hierarchy or mesh), nor do they facilitate association of | multiple caches (e.g., in a hierarchy or mesh), nor do they | |||
| stored responses from disparate origins. | facilitate association of stored responses from disparate origins. | |||
| 1.1. Notational Conventions | 1.1. Notational Conventions | |||
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
| "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
| "OPTIONAL" in this document are to be interpreted as described in | "OPTIONAL" in this document are to be interpreted as described in | |||
| BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all | BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all | |||
| capitals, as shown here. | capitals, as shown here. | |||
| This specification uses the following terminology from | This specification uses the following terminology from | |||
| [STRUCTURED-FIELDS]: List, String, Parameter. | [STRUCTURED-FIELDS]: List, String, Parameter. | |||
| 2. The Cache-Groups Response Header Field | 2. The Cache-Groups Response Header Field | |||
| The Cache-Groups HTTP Response Header is a List of Strings | The Cache-Groups HTTP response header field is a List of Strings | |||
| [STRUCTURED-FIELDS]. Each member of the list is an opaque value that | (Sections 3.1 and 3.3.3 of [STRUCTURED-FIELDS]). Each member of the | |||
| identifies a group that the response belongs to. | List is a value that identifies a group that the response belongs to. | |||
| These Strings are opaque -- while they might have some meaning to the | ||||
| server that creates them, the cache does not have any insight into | ||||
| their structure or content (beyond uniquely identifying a group). | ||||
| HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
| Content-Type: application/javascript | Content-Type: application/javascript | |||
| Cache-Control: max-age=3600 | Cache-Control: max-age=3600 | |||
| Cache-Groups: "scripts" | Cache-Groups: "scripts" | |||
| The ordering of members is not significant. Unrecognised Parameters | The ordering of members is not significant. Unrecognised Parameters | |||
| MUST be ignored. | are to be ignored. | |||
| Implementations MUST support at least 128 groups in a field value, | Implementations MUST support at least 32 groups in a field value, | |||
| with up to at least 128 characters in each member. Note that generic | with up to at least 32 characters in each member. Note that generic | |||
| limitations on HTTP field lengths may constrain the size of this | limitations on HTTP field lengths may constrain the size of this | |||
| field value in practice. | field value in practice. | |||
| 2.1. Identifying Grouped Responses | 2.1. Identifying Grouped Responses | |||
| Two responses stored in the same cache are considered to have the | Two responses stored in the same cache are considered to belong to | |||
| same group when all of the following conditions are met: | the same group when all of the following conditions are met: | |||
| 1. They both contain a Cache-Groups response header field that | 1. They both contain a Cache-Groups response header field that | |||
| contains the same String (in any position in the List), when | contains the same String (in any position in the List), when | |||
| compared character-by-character. | compared character-by-character (case sensitive). | |||
| 2. The both share the same URI origin (per Section 4.3.1 of [HTTP]). | 2. They both share the same URI origin (per Section 4.3.1 of | |||
| [HTTP]). | ||||
| 2.2. Cache Behaviour | 2.2. Cache Behaviour | |||
| 2.2.1. Invalidation | 2.2.1. Invalidation | |||
| A cache that invalidates a stored response MAY invalidate any stored | A cache that invalidates a stored response MAY invalidate any stored | |||
| responses that share groups (per Section 2.1) with that response. | responses that share groups (per Section 2.1) with that response. | |||
| Note that further grouped invalidations are not triggered by a | ||||
| grouped invalidation; i.e., this mechanism does not cascade. | ||||
| Cache extensions can explicitly strengthen the requirement above. | Cache extensions can explicitly strengthen the requirement above. | |||
| For example, a targeted cache control header field [TARGETED] might | For example, a targeted cache control header field [TARGETED] might | |||
| specify that caches processing it are required to invalidate such | specify that caches processing it are required to invalidate such | |||
| responses. | responses. | |||
| 3. The Cache-Group-Invalidation Response Header Field | 3. The Cache-Group-Invalidation Response Header Field | |||
| The Cache-Group-Invalidation response header field is a List of | The Cache-Group-Invalidation response header field is a List of | |||
| Strings [STRUCTURED-FIELDS]. Each member of the list is an opaque | Strings (Sections 3.1 and 3.3.3 of [STRUCTURED-FIELDS]). Each member | |||
| value that identifies a group that the response invalidates, per | of the List is a value that identifies a group that the response | |||
| Section 2.2.1. | invalidates, per Section 2.2.1. | |||
| For example, a POST request that has side effects on two cache groups | For example, following a POST request that has side effects on two | |||
| could indicate that stored responses associated with either or both | cache groups, the corresponding response could indicate that stored | |||
| of those groups should be invalidated with: | responses associated with either or both of those groups should be | |||
| invalidated with: | ||||
| HTTP/1.1 200 OK | HTTP/1.1 200 OK | |||
| Content-Type: text/html | Content-Type: text/html | |||
| Cache-Group-Invalidation: "eurovision-results", "kylie-minogue" | Cache-Group-Invalidation: "eurovision-results", "australia" | |||
| The Cache-Group-Invalidation header field MUST be ignored on | The Cache-Group-Invalidation header field MUST be ignored on | |||
| responses to requests that have a safe method (e.g., GET; see | responses to requests that have a safe method (e.g., GET; see | |||
| Section 9.2.1 of [HTTP]). | Section 9.2.1 of [HTTP]). | |||
| A cache that receives a Cache-Group-Invalidation header field on a | A cache that receives a Cache-Group-Invalidation header field on a | |||
| response to an unsafe request MAY invalidate any stored responses | response to an unsafe request MAY invalidate any stored responses | |||
| that share groups (per Section 2.1) with any of the listed groups. | that share groups (per Section 2.1) with any of the listed groups. | |||
| Cache extensions can explicitly strengthen the requirement above. | Cache extensions can explicitly strengthen the requirement above. | |||
| For example, a targeted cache control header field [TARGETED] might | For example, a targeted cache control header field [TARGETED] might | |||
| specify that caches processing it are required to respect the Cache- | specify that caches processing it are required to respect the Cache- | |||
| Group-Invalidation signal. | Group-Invalidation signal. | |||
| The ordering of members is not significant. Unrecognised Parameters | The ordering of members is not significant. Unrecognised Parameters | |||
| MUST be ignored. | are to be ignored. | |||
| Implementations MUST support at least 128 groups in a field value, | Implementations MUST support at least 32 groups in a field value, | |||
| with up to at least 128 characters in each member. Note that generic | with up to at least 32 characters in each member. Note that generic | |||
| limitations on HTTP field lengths may constrain the size of this | limitations on HTTP field lengths may constrain the size of this | |||
| field value in practice. | field value in practice. | |||
| 4. IANA Considerations | 4. IANA Considerations | |||
| IANA should perform the following tasks: | IANA should perform the following tasks: | |||
| 4.1. HTTP Field Names | 4.1. HTTP Field Names | |||
| Enter the following into the Hypertext Transfer Protocol (HTTP) Field | Enter the following into the Hypertext Transfer Protocol (HTTP) Field | |||
| skipping to change at page 6, line 36 ¶ | skipping to change at page 6, line 43 ¶ | |||
| Requirement Levels", BCP 14, RFC 2119, | Requirement Levels", BCP 14, RFC 2119, | |||
| DOI 10.17487/RFC2119, March 1997, | DOI 10.17487/RFC2119, March 1997, | |||
| <https://www.rfc-editor.org/info/rfc2119>. | <https://www.rfc-editor.org/info/rfc2119>. | |||
| [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC | |||
| 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, | |||
| May 2017, <https://www.rfc-editor.org/info/rfc8174>. | May 2017, <https://www.rfc-editor.org/info/rfc8174>. | |||
| [STRUCTURED-FIELDS] | [STRUCTURED-FIELDS] | |||
| Nottingham, M. and P. Kamp, "Structured Field Values for | Nottingham, M. and P. Kamp, "Structured Field Values for | |||
| HTTP", draft-ietf-httpbis-sfbis-06 (work in progress), | HTTP", RFC 9651, DOI 10.17487/RFC9651, September 2024, | |||
| April 2024. | <https://www.rfc-editor.org/info/rfc9651>. | |||
| 6.2. Informative References | 6.2. Informative References | |||
| [TARGETED] | [TARGETED] | |||
| Ludin, S., Nottingham, M., and Y. Wu, "Targeted HTTP Cache | Ludin, S., Nottingham, M., and Y. Wu, "Targeted HTTP Cache | |||
| Control", RFC 9213, DOI 10.17487/RFC9213, June 2022, | Control", RFC 9213, DOI 10.17487/RFC9213, June 2022, | |||
| <https://www.rfc-editor.org/info/rfc9213>. | <https://www.rfc-editor.org/info/rfc9213>. | |||
| Appendix A. Acknowledgements | Appendix A. Acknowledgements | |||
| Thanks to Stephen Ludin for his review and suggestions. | Thanks to Stephen Ludin for his review and suggestions. | |||
| Author's Address | Author's Address | |||
| Mark Nottingham | Mark Nottingham | |||
| Prahran | Cloudflare | |||
| Melbourne | ||||
| Australia | Australia | |||
| Email: mnot@mnot.net | Email: mnot@mnot.net | |||
| URI: https://www.mnot.net/ | URI: https://www.mnot.net/ | |||
| End of changes. 26 change blocks. | ||||
| 45 lines changed or deleted | 53 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||