<?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.6.35 (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-nottingham-http-cache-groups-00" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.17.3 -->
  <front>
    <title>HTTP Cache Groups</title>
    <seriesInfo name="Internet-Draft" value="draft-nottingham-http-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 41?>

<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-nottingham-http-cache-groups/"/>.
      </t>
      <t>
         information can be found at <eref target="https://mnot.github.io/I-D/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/mnot/I-D/labels/http-cache-groups"/>.</t>
    </note>
  </front>
  <middle>
    <?line 45?>

<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>They both contain a Cache-Groups response header field that contains the same String in any position, when compared character-by-character.</li>
          <li>The both share the same URI origin (per <xref section="4.3.1" sectionFormat="of" target="HTTP"/>).</li>
          <li>If being considered for revalidation (<xref target="revalidation"/>), they both have the "revalidate" Parameter.</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>
        <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>
        <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 161?>

<section anchor="acknowledgements">
      <name>Acknowledgements</name>
      <t>Thanks to Stephen Ludin for his review and suggestions.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA9VZbW/byBH+zl+xlT80KUTZcoI2Ua531dlO7KtfUr+gOBwO
wYpcSVuTXGZ3aUU1nN/S39Jf1mdmSYqUnbsUKFDchyQiuTs7L888M7OJ4zjy
2mdqIo6vr9+LA5kslXhnTVW6SM5mVt1NotQkhcyxJLVy7uPCeK+LxVLm8dL7
Mk5oT7zgPfHeXpRKj7X3h9Pro4cowcPC2PVEOJ9GkS7tRHhbOb+/t/d6bz+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