<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.2 (Ruby 3.2.2) -->
<?rfc tocindent="yes"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-httpbis-cache-groups-00" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.18.2 -->
  <front>
    <title>HTTP Cache Groups</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-cache-groups-00"/>
    <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
      <organization/>
      <address>
        <postal>
          <postalLine>Prahran</postalLine>
          <postalLine>Australia</postalLine>
        </postal>
        <email>mnot@mnot.net</email>
        <uri>https://www.mnot.net/</uri>
      </address>
    </author>
    <date/>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <?line 44?>

<t>This specification introduces a means of describing the relationships between stored responses in HTTP caches, "grouping" them by associating a stored response with one or more opaque strings.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ietf-httpbis-cache-groups/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        HTTP Working Group mailing list (<eref target="mailto:ietf-http-wg@w3.org"/>),
        which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
        Working Group information can be found at <eref target="https://httpwg.org/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/httpwg/http-extensions/labels/cache-groups"/>.</t>
    </note>
  </front>
  <middle>
    <?line 48?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>HTTP caching <xref target="HTTP-CACHING"/> operates at the granularity of a single resource; the freshness of one stored response does not effect that of others. This granularity can make caching more efficient -- for example, when a page is composed of many assets that have different requirements for caching.</t>
      <t>However, there are also cases where the relationship between stored responses could be used to improve cache efficiency.</t>
      <t>For example, it's common for a set of closely-related resources to be deployed on a site, such as is the case for many JavaScript libraries and frameworks. These resources are typically deployed with long freshness lifetimes for caching. When that period passes, the cache will need to revalidate each stored response in a short period of time. Grouping these resources can be used to allow a cache to consider them all as being revalidated when any single response in the group is revalidated, removing the need to revalidate all of them individually and avoiding the associated overhead.</t>
      <t>Likewise, when some resources change, it implies that other resources may have also changed. This might be because a state-changing request has side effects on other resources, or it might be purely for administrative convenience (e.g., "invalidate this part of the site"). Grouping responses together provides a dedicated way to express these relationships, instead of relying on things like URL structure.</t>
      <t>In addition to sharing revalidation and invalidation events, the relationships indicated by grouping can also be used by caches to optimise their operation; for example, it could be used to inform the operation of cache eviction algorithms.</t>
      <t><xref target="cache-groups"/> introduces a means of describing the relationships between stored responses in HTTP caches, "grouping" them by associating a stored response with one or more opaque strings. It also describes how caches can use that information to apply revalidation and invalidation events to members of a group.</t>
      <t><xref target="cache-group-invalidation"/> introduces one new source of such events: a HTTP response header that allows a state-changing response to trigger a group invalidation.</t>
      <t>These mechanisms operate within a single cache, across the stored responses associated with a single origin server. They do not address this issues of synchronising state between multiple caches (e.g., in a hierarchy or mesh), nor do they facilitate association of stored responses from disparate origins.</t>
      <section anchor="notational-conventions">
        <name>Notational Conventions</name>
        <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
        <?line -18?>

<t>This specification uses the following terminology from <xref target="STRUCTURED-FIELDS"/>: List, String, Parameter.</t>
      </section>
    </section>
    <section anchor="cache-groups">
      <name>The Cache-Groups Response Header Field</name>
      <t>The Cache-Groups HTTP Response Header is a List of Strings <xref target="STRUCTURED-FIELDS"/>. Each member of the list is an opaque value that identifies a group that the response belongs to.</t>
      <t>For example, an origin server might group all of the assets in a fictional ExampleJS package, so that it can be revalidated and invalidated as a single unit. Additionally, it might group together all scripting assets on the server, so that they can be invalidated together.</t>
      <sourcecode type="http-message"><![CDATA[
HTTP/1.1 200 OK
Content-Type: application/javascript
Cache-Control: max-age=3600
Cache-Groups: "ExampleJS";revalidate, "scripts"
]]></sourcecode>
      <t>This specification defines one Parameter for Cache-Groups, "revalidate", that indicates that the resources associated with that group share revalidation; see <xref target="revalidation"/>.</t>
      <t>The ordering of members of Cache-Groups is not significant.</t>
      <section anchor="identify">
        <name>Identifying Grouped Responses</name>
        <t>Two responses stored in the same cache are considered to have the same group when all of the following conditions are met:</t>
        <ol spacing="normal" type="1"><li>
            <t>They both contain a Cache-Groups response header field that contains the same String in any position, when compared character-by-character.</t>
          </li>
          <li>
            <t>The both share the same URI origin (per <xref section="4.3.1" sectionFormat="of" target="HTTP"/>).</t>
          </li>
          <li>
            <t>If being considered for revalidation (<xref target="revalidation"/>), they both have the "revalidate" Parameter.</t>
          </li>
        </ol>
      </section>
      <section anchor="cache-behaviour">
        <name>Cache Behaviour</name>
        <section anchor="revalidation">
          <name>Revalidation</name>
          <t>A cache that successfully revalidates a stored response <bcp14>MAY</bcp14> consider any stored responses that share a group (per <xref target="identify"/>) as also being revalidated at the same time.</t>
          <t>Cache extensions can explicitly strengthen the requirement above. For example, a targeted cache control header field <xref target="TARGETED"/> might specify that caches processing it are required to revalidate such responses.</t>
        </section>
        <section anchor="invalidation">
          <name>Invalidation</name>
          <t>A cache that invalidates a stored response <bcp14>MAY</bcp14> invalidate any stored responses that share groups (per <xref target="identify"/>) with that response.</t>
          <t>Cache extensions can explicitly strengthen the requirement above. For example, a targeted cache control header field <xref target="TARGETED"/> might specify that caches processing it are required to invalidate such responses.</t>
        </section>
      </section>
    </section>
    <section anchor="cache-group-invalidation">
      <name>The Cache-Group-Invalidation Response Header Field</name>
      <t>The Cache-Group-Invalidation response header field is a List of Strings <xref target="STRUCTURED-FIELDS"/>. Each member of the list is an opaque value that identifies a group that the response invalidates, per <xref target="invalidation"/>.</t>
      <t>For example, a POST request that has side effects on two cache groups could indicate that stored responses associated with either or both of those groups should be invalidated with:</t>
      <sourcecode type="http-message"><![CDATA[
HTTP/1.1 200 OK
Content-Type: text/html
Cache-Group-Invalidation: "eurovision-results", "kylie-minogue"
]]></sourcecode>
      <t>The Cache-Group-Invalidation header field <bcp14>MUST</bcp14> be ignored on responses to requests that have a safe method (e.g., GET; see <xref section="9.2.1" sectionFormat="of" target="HTTP"/>.</t>
      <t>A cache that receives a Cache-Group-Invalidation header field on a response to an unsafe request <bcp14>MAY</bcp14> invalidate any stored responses that share groups (per <xref target="identify"/>) with any of the listed groups.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t><em>TBD</em></t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t><em>TBD</em></t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references anchor="sec-normative-references">
        <name>Normative References</name>
        <reference anchor="HTTP">
          <front>
            <title>HTTP Semantics</title>
            <author fullname="R. Fielding" initials="R." role="editor" surname="Fielding"/>
            <author fullname="M. Nottingham" initials="M." role="editor" surname="Nottingham"/>
            <author fullname="J. Reschke" initials="J." role="editor" surname="Reschke"/>
            <date month="June" year="2022"/>
            <abstract>
              <t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document describes the overall architecture of HTTP, establishes common terminology, and defines aspects of the protocol that are shared by all versions. In this definition are core protocol elements, extensibility mechanisms, and the "http" and "https" Uniform Resource Identifier (URI) schemes.</t>
              <t>This document updates RFC 3864 and obsoletes RFCs 2818, 7231, 7232, 7233, 7235, 7538, 7615, 7694, and portions of 7230.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="97"/>
          <seriesInfo name="RFC" value="9110"/>
          <seriesInfo name="DOI" value="10.17487/RFC9110"/>
        </reference>
        <reference anchor="HTTP-CACHING">
          <front>
            <title>HTTP Caching</title>
            <author fullname="R. Fielding" initials="R." role="editor" surname="Fielding"/>
            <author fullname="M. Nottingham" initials="M." role="editor" surname="Nottingham"/>
            <author fullname="J. Reschke" initials="J." role="editor" surname="Reschke"/>
            <date month="June" year="2022"/>
            <abstract>
              <t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document defines HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages.</t>
              <t>This document obsoletes RFC 7234.</t>
            </abstract>
          </front>
          <seriesInfo name="STD" value="98"/>
          <seriesInfo name="RFC" value="9111"/>
          <seriesInfo name="DOI" value="10.17487/RFC9111"/>
        </reference>
        <reference anchor="STRUCTURED-FIELDS">
          <front>
            <title>Structured Field Values for HTTP</title>
            <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
            <author fullname="P-H. Kamp" surname="P-H. Kamp"/>
            <date month="February" year="2021"/>
            <abstract>
              <t>This document describes a set of data types and associated algorithms that are intended to make it easier and safer to define and handle HTTP header and trailer fields, known as "Structured Fields", "Structured Headers", or "Structured Trailers". It is intended for use by specifications of new HTTP fields that wish to use a common syntax that is more restrictive than traditional HTTP field values.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="8941"/>
          <seriesInfo name="DOI" value="10.17487/RFC8941"/>
        </reference>
        <reference anchor="RFC2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
      </references>
      <references anchor="sec-informative-references">
        <name>Informative References</name>
        <reference anchor="TARGETED">
          <front>
            <title>Targeted HTTP Cache Control</title>
            <author fullname="S. Ludin" initials="S." surname="Ludin"/>
            <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
            <author fullname="Y. Wu" initials="Y." surname="Wu"/>
            <date month="June" year="2022"/>
            <abstract>
              <t>This specification defines a convention for HTTP response header fields that allow cache directives to be targeted at specific caches or classes of caches. It also defines one such header field, the CDN-Cache-Control response header field, which is targeted at content delivery network (CDN) caches.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9213"/>
          <seriesInfo name="DOI" value="10.17487/RFC9213"/>
        </reference>
      </references>
    </references>
    <?line 164?>

<section anchor="acknowledgements">
      <name>Acknowledgements</name>
      <t>Thanks to Stephen Ludin for his review and suggestions.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA9VZbW/cxhH+zl+xlT7ULo4nnWy08TlNcpbkSKlsqXpBEASB
sUfu8bYiuczuUueroPyW/pb+sj4zS/LI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