source: draft-ietf-httpbis/latest/p6-cache.xml @ 2100

Last change on this file since 2100 was 2100, checked in by mnot@…, 8 years ago

Clarify rules for 304 updates, motivate last point; addresses #406

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/xml
File size: 105.8 KB
RevLine 
[29]1<?xml version="1.0" encoding="utf-8"?>
[768]2<?xml-stylesheet type='text/xsl' href='../myxml2rfc.xslt'?>
[8]3<!DOCTYPE rfc [
4  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
5  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
6  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
7  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
8  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
9  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
10  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
11  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
12  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
13  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
[29]14  <!ENTITY ID-VERSION "latest">
[2080]15  <!ENTITY ID-MONTH "January">
16  <!ENTITY ID-YEAR "2013">
[1692]17  <!ENTITY mdash "&#8212;">
18  <!ENTITY Note "<x:h xmlns:x='http://purl.org/net/xml2rfc/ext'>Note:</x:h>">
[1518]19  <!ENTITY architecture                "<xref target='Part1' x:rel='#architecture' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1875]20  <!ENTITY conformance                 "<xref target='Part1' x:rel='#conformance' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[424]21  <!ENTITY notation                    "<xref target='Part1' x:rel='#notation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1399]22  <!ENTITY acks                        "<xref target='Part1' x:rel='#acks' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1518]23  <!ENTITY whitespace                  "<xref target='Part1' x:rel='#whitespace' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
24  <!ENTITY field-components            "<xref target='Part1' x:rel='#field.components' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[538]25  <!ENTITY uri                         "<xref target='Part1' x:rel='#uri' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1399]26  <!ENTITY effective-request-uri       "<xref target='Part1' x:rel='#effective.request.uri' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[31]27  <!ENTITY messaging                   "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1374]28  <!ENTITY semantics                   "<xref target='Part2' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[183]29  <!ENTITY conditional                 "<xref target='Part4' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[538]30  <!ENTITY partial                     "<xref target='Part5' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[31]31  <!ENTITY combining-byte-ranges       "<xref target='Part5' x:rel='#combining.byte.ranges' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1436]32  <!ENTITY http-date                   "<xref target='Part2' x:rel='#http.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[31]33  <!ENTITY header-authorization        "<xref target='Part7' x:rel='#header.authorization' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
34  <!ENTITY header-connection           "<xref target='Part1' x:rel='#header.connection' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1436]35  <!ENTITY header-date                 "<xref target='Part2' x:rel='#header.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1860]36  <!ENTITY header-last-modified        "<xref target='Part4' x:rel='#header.last-modified' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
37  <!ENTITY header-vary                 "<xref target='Part2' x:rel='#header.vary' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[205]38  <!ENTITY header-via                  "<xref target='Part1' x:rel='#header.via' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[697]39  <!ENTITY header-fields               "<xref target='Part1' x:rel='#header.fields' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[2088]40  <!ENTITY GET                         "<xref target='Part2' x:rel='#GET' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[31]41  <!ENTITY safe-methods                "<xref target='Part2' x:rel='#safe.methods' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1374]42  <!ENTITY entity-tags                 "<xref target='Part4' x:rel='#header.etag' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[607]43  <!ENTITY weak-and-strong             "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1374]44  <!ENTITY lastmod-comparison          "<xref target='Part4' x:rel='#lastmod.comparison' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[1635]45  <!ENTITY status-codes                "<xref target='Part2' x:rel='#status.codes' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[943]46  <!ENTITY status.2xx                  "<xref target='Part2' x:rel='#status.2xx' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[2041]47  <!ENTITY transformations             "<xref target='Part1' x:rel='#message.transformations' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
[8]48]>
49<?rfc toc="yes" ?>
[29]50<?rfc symrefs="yes" ?>
51<?rfc sortrefs="yes" ?>
[8]52<?rfc compact="yes"?>
53<?rfc subcompact="no" ?>
54<?rfc linkmailto="no" ?>
55<?rfc editing="no" ?>
[203]56<?rfc comments="yes"?>
57<?rfc inline="yes"?>
[799]58<?rfc rfcedstyle="yes"?>
[8]59<?rfc-ext allow-markup-in-artwork="yes" ?>
60<?rfc-ext include-references-in-index="yes" ?>
[538]61<rfc category="std" docName="draft-ietf-httpbis-p6-cache-&ID-VERSION;" ipr="pre5378Trust200902"
[1477]62  obsoletes="2616" x:maturity-level="proposed" xmlns:x="http://purl.org/net/xml2rfc/ext">
[1472]63<x:link rel="prev" basename="p5-range"/>
64<x:link rel="next" basename="p7-auth"/>
[1522]65<x:feedback template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=&lt;{ref}&gt;:"/>
[547]66<front>
[8]67
[1864]68  <title abbrev="HTTP/1.1 Caching">Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
[8]69
[547]70  <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
[1106]71    <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[547]72    <address>
[8]73      <postal>
[1106]74        <street>345 Park Ave</street>
75        <city>San Jose</city>
[8]76        <region>CA</region>
[1106]77        <code>95110</code>
[29]78        <country>USA</country>
[8]79      </postal>
[29]80      <email>fielding@gbiv.com</email>
81      <uri>http://roy.gbiv.com/</uri>
[8]82    </address>
[547]83  </author>
[8]84
[601]85  <author fullname="Mark Nottingham" initials="M." role="editor" surname="Nottingham">
[1914]86    <organization>Akamai</organization>
[607]87    <address>
88      <email>mnot@mnot.net</email>
89      <uri>http://www.mnot.net/</uri>
[601]90    </address>
91  </author>
92
[547]93  <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
94    <organization abbrev="greenbytes">greenbytes GmbH</organization>
95    <address>
[95]96      <postal>
97        <street>Hafenweg 16</street>
98        <city>Muenster</city><region>NW</region><code>48155</code>
99        <country>Germany</country>
100      </postal>
[607]101      <email>julian.reschke@greenbytes.de</email>
102      <uri>http://greenbytes.de/tech/webdav/</uri>
[95]103    </address>
[547]104  </author>
[95]105
[547]106  <date month="&ID-MONTH;" year="&ID-YEAR;" />
107  <workgroup>HTTPbis Working Group</workgroup>
[8]108
[540]109<abstract>
110<t>
[949]111   The Hypertext Transfer Protocol (HTTP) is an application-level protocol for
[1808]112   distributed, collaborative, hypertext information systems. This document
113   defines requirements on HTTP caches and the associated header fields
[1373]114   that control cache behavior or indicate cacheable response messages.
115</t>
[540]116</abstract>
[36]117
[540]118<note title="Editorial Note (To be removed by RFC Editor)">
[1268]119  <t>
[1764]120    Discussion of this draft takes place on the HTTPBIS working group
[1268]121    mailing list (ietf-http-wg@w3.org), which is archived at
122    <eref target="http://lists.w3.org/Archives/Public/ietf-http-wg/"/>.
123  </t>
124  <t>
125    The current issues list is at
126    <eref target="http://tools.ietf.org/wg/httpbis/trac/report/3"/> and related
127    documents (including fancy diffs) can be found at
128    <eref target="http://tools.ietf.org/wg/httpbis/"/>.
129  </t>
130  <t>
[1929]131    The changes in this draft are summarized in <xref target="changes.since.21"/>.
[1268]132  </t>
[540]133</note>
134
[949]135   </front>
136   <middle>
[8]137
[540]138<section anchor="caching" title="Introduction">
139<t>
[949]140   HTTP is typically used for distributed information systems, where
141   performance can be improved by the use of response caches. This document
142   defines aspects of HTTP/1.1 related to caching and reusing response
143   messages.
[540]144</t>
[157]145
[540]146<section anchor="intro.purpose" title="Purpose">
147<iref item="cache" />
148<t>
[949]149   An HTTP <x:dfn>cache</x:dfn> is a local store of response messages and the
150   subsystem that controls its message storage, retrieval, and deletion. A
151   cache stores cacheable responses in order to reduce the response time and
152   network bandwidth consumption on future, equivalent requests. Any client or
153   server &MAY; employ a cache, though a cache cannot be used by a server that
154   is acting as a tunnel.
[540]155</t>
156<t>
[1374]157   The goal of caching in HTTP/1.1 is to significantly improve performance
158   by reusing a prior response message to satisfy a current request.
159   A stored response is considered "fresh", as defined in
160   <xref target="expiration.model" />, if the response can be reused without
161   "validation" (checking with the origin server to see if the cached response
162   remains valid for this request).  A fresh cache response can therefore
163   reduce both latency and network transfers each time it is reused.
164   When a cached response is not fresh, it might still be reusable if it can
165   be freshened by validation (<xref target="validation.model" />) or if the
166   origin is unavailable.
[540]167</t>
168</section>
[157]169
[540]170<section anchor="intro.terminology" title="Terminology">
[575]171<t>
[949]172   This specification uses a number of terms to refer to the roles played by
173   participants in, and objects of, HTTP caching.
[540]174</t>
175<t>
[1112]176   <iref item="cache" />
177   <x:dfn>cache</x:dfn>
178   <list>
[2030]179      <t>A conformant implementation of an HTTP cache. Note that this implies
[1112]180        an HTTP/1.1 cache; this specification does not define conformance
181        for HTTP/1.0 caches.</t>
182   </list>
183</t>
184<t anchor="shared.and.non-shared.caches">
185   <iref item="shared cache" />
186   <x:dfn>shared cache</x:dfn>
187   <list>
[1374]188      <t>A cache that stores responses to be reused by more than one user;
189         usually (but not always) deployed as part of an intermediary.</t>
[1112]190   </list>
191</t>
192<t>
193   <iref item="private cache" />
194   <x:dfn>private cache</x:dfn>
195   <list>
196      <t>A cache that is dedicated to a single user.</t>
197   </list>
198</t>
199<t>
[949]200   <iref item="cacheable" />
201   <x:dfn>cacheable</x:dfn>
202   <list>
203      <t>A response is cacheable if a cache is allowed to store a copy of the
204      response message for use in answering subsequent requests. Even when a
205      response is cacheable, there might be additional constraints on whether
[1112]206      a cache can use the stored copy to satisfy a particular request.</t>
[949]207   </list>
[540]208</t>
209<t>
[949]210   <iref item="explicit expiration time" />
211   <x:dfn>explicit expiration time</x:dfn>
212   <list>
213      <t>The time at which the origin server intends that a representation
[2053]214      no longer be used by a cache without further validation.</t>
[949]215   </list>
[540]216</t>
217<t>
[949]218   <iref item="heuristic expiration time" />
219   <x:dfn>heuristic expiration time</x:dfn>
220   <list>
221      <t>An expiration time assigned by a cache when no explicit expiration
222      time is available.</t>
223   </list>
[540]224</t>
225<t>
[949]226   <iref item="age" />
227   <x:dfn>age</x:dfn>
228   <list>
229      <t>The age of a response is the time since it was sent by, or
230      successfully validated with, the origin server.</t>
231   </list>
[540]232</t>
233<t>
[949]234   <iref item="first-hand" />
235   <x:dfn>first-hand</x:dfn>
236   <list>
237      <t>A response is first-hand if the freshness model is not in use; i.e.,
238      its age is 0.</t>
239   </list>
[540]240</t>
241<t>
[949]242   <iref item="freshness lifetime" />
243   <x:dfn>freshness lifetime</x:dfn>
244   <list>
245      <t>The length of time between the generation of a response and its
246      expiration time.</t>
247   </list>
[540]248</t>
249<t>
[949]250   <iref item="fresh" />
251   <x:dfn>fresh</x:dfn>
252   <list>
253      <t>A response is fresh if its age has not yet exceeded its freshness
254      lifetime.</t>
255   </list>
[540]256</t>
257<t>
[949]258   <iref item="stale" />
259   <x:dfn>stale</x:dfn>
260   <list>
261      <t>A response is stale if its age has passed its freshness lifetime
262      (either explicit or heuristic).</t>
263   </list>
[540]264</t>
265<t>
[949]266   <iref item="validator" />
267   <x:dfn>validator</x:dfn>
268   <list>
[1739]269      <t>A protocol element (e.g., an entity-tag or a <x:ref>Last-Modified</x:ref>
270      time) that is used to find out whether a stored response is an equivalent
271      copy of a representation. See &weak-and-strong;.</t>
[949]272   </list>
[540]273</t>
[1374]274<t>
275   <iref item="strong validator" />
[1376]276   <iref item="validator" subitem="strong" />
[1374]277   <x:dfn>strong validator</x:dfn>
278   <list>
279      <t>A validator that is defined by the origin server such that its
[1910]280         current value will change if the representation data changes; i.e.,
[1374]281         an entity-tag that is not marked as weak (&entity-tags;) or,
[1739]282         if no entity-tag is provided, a <x:ref>Last-Modified</x:ref> value
283         that is strong in the sense defined by &lastmod-comparison;.</t>
[1374]284   </list>
285</t>
[540]286</section>
[157]287
[1875]288<section title="Conformance and Error Handling" anchor="conformance">
[540]289<t>
[847]290   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
291   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
292   document are to be interpreted as described in <xref target="RFC2119"/>.
[540]293</t>
294<t>
[1875]295   Conformance criteria and considerations regarding error handling
296   are defined in &conformance;.
[540]297</t>
298</section>
[96]299
[424]300<section title="Syntax Notation" anchor="notation">
301<t>
[1518]302   This specification uses the Augmented Backus-Naur Form (ABNF) notation
303   of <xref target="RFC5234"/> with the list rule extension defined in
[1805]304   &notation;. <xref target="imported.abnf"/> describes rules imported from
305   other documents. <xref target="collected.abnf"/> shows the collected ABNF
[1518]306   with the list rule expanded.
[543]307</t>
[205]308
[1323]309<section title="Delta Seconds" anchor="delta-seconds">
310<t>
311   The delta-seconds rule specifies a non-negative integer, representing time
312   in seconds.
313</t>
314<figure><artwork type="abnf2616"><iref item="Grammar" primary="true" subitem="delta-seconds" />
315  <x:ref>delta-seconds</x:ref>  = 1*<x:ref>DIGIT</x:ref>
316</artwork></figure>
317<t>
318   If an implementation receives a delta-seconds value larger than the largest
319   positive integer it can represent, or if any of its subsequent calculations
[1746]320   overflows, it &MUST; consider the value to be 2147483648
321   (2<x:sup>31</x:sup>). Recipients parsing a delta-seconds value &MUST; use
322   an arithmetic type of at least 31 bits of range, and senders &MUST-NOT;
323   send delta-seconds with a value greater than 2147483648.
[1323]324</t>
[424]325</section>
[1323]326
[424]327</section>
[1745]328</section>
[424]329
[1751]330<section anchor="caching.overview" title="Overview of Cache Operation">
[1374]331<iref item="cache entry" />
332<iref item="cache key" />
333<t>
334   Proper cache operation preserves the semantics of HTTP transfers
335   (&semantics;) while eliminating the transfer of information already held
336   in the cache.  Although caching is an entirely &OPTIONAL; feature of HTTP,
337   we assume that reusing the cached response is desirable and that such
338   reuse is the default behavior when no requirement or locally-desired
339   configuration prevents it.  Therefore, HTTP cache requirements are focused
340   on preventing a cache from either storing a non-reusable response or
341   reusing a stored response inappropriately.
342</t>
343<t>
344   Each <x:dfn>cache entry</x:dfn> consists of a cache key and one or more
[1746]345   HTTP responses corresponding to prior requests that used the same key. The
346   most common form of cache entry is a successful result of a retrieval
[2088]347   request: i.e., a <x:ref>200 (OK)</x:ref> response to a GET request, which
348   contains a representation of the resource identified by the request target
349   (&GET;). However, it is also possible to cache
350   negative results (e.g., <x:ref>404 (Not Found)</x:ref>),
351   incomplete results (e.g., <x:ref>206 (Partial Content)</x:ref>), and
352   responses to methods other than GET if the method's definition allows such
353   caching and defines something suitable for use as a cache key.
[1374]354</t>
355<t>
356   The default <x:dfn>cache key</x:dfn> consists of the request method and
357   target URI.  However, since HTTP caches in common use today are typically
[1752]358   limited to caching responses to GET, many implementations simply decline
[1374]359   other methods and use only the URI as the key.
360</t>
361<t>
362   If a request target is subject to content negotiation, its cache entry
363   might consist of multiple stored responses, each differentiated by a
364   secondary key for the values of the original request's selecting header
365   fields (<xref target="caching.negotiated.responses"/>).
366</t>
[1751]367</section>
[424]368
[1751]369<section anchor="response.cacheability" title="Storing Responses in Caches">
[540]370<t>
[949]371   A cache &MUST-NOT; store a response to any request, unless:
372   <list style="symbols">
373      <t>The request method is understood by the cache and defined as being
374      cacheable, and</t>
375      <t>the response status code is understood by the cache, and</t>
376      <t>the "no-store" cache directive (see <xref
377      target="header.cache-control" />) does not appear in request or response
[994]378      header fields, and</t>
[949]379      <t>the "private" cache response directive (see <xref
[1793]380      target="cache-response-directive.private" />) does not appear in the
381      response, if the cache is shared, and</t>
[1746]382      <t>the <x:ref>Authorization</x:ref> header field (see
383      &header-authorization;) does not appear in the request, if the cache is
384      shared, unless the response explicitly allows it (see <xref
385      target="caching.authenticated.responses" />), and</t>
[949]386      <t>the response either:
387         <list style="symbols">
[1737]388            <t>contains an <x:ref>Expires</x:ref> header field (see
389            <xref target="header.expires"/>), or</t>
[949]390            <t>contains a max-age response cache directive (see <xref
[1793]391            target="cache-response-directive.max-age" />), or</t>
[949]392            <t>contains a s-maxage response cache directive and the cache is
393            shared, or</t>
394            <t>contains a Cache Control Extension (see <xref
395            target="cache.control.extensions" />) that allows it to be cached,
396            or</t>
397            <t>has a status code that can be served with heuristic freshness
398            (see <xref target="heuristic.freshness" />).</t>
399         </list>
400      </t>
401   </list>
[540]402</t>
403<t>
[1292]404   Note that any of the requirements listed above can be overridden by a
[1291]405   cache-control extension; see <xref target="cache.control.extensions" />.
406</t>
407<t>
[949]408   In this context, a cache has "understood" a request method or a response
[1374]409   status code if it recognizes it and implements any cache-specific
410   behavior.
[737]411</t>
412<t>
[1752]413   Note that, in normal operation, many caches will not store a response that
[949]414   has neither a cache validator nor an explicit expiration time, as such
415   responses are not usually useful to store. However, caches are not
416   prohibited from storing such responses.
[540]417</t>
[1751]418
419<section anchor="incomplete.responses" title="Storing Incomplete Responses">
[540]420<t>
[1746]421   A response message is considered complete when all of the octets indicated
422   by the message framing (&messaging;) are received prior to the connection
423   being closed. If the request is GET, the response status is <x:ref>200
424   (OK)</x:ref>, and the entire response header block has been received, a
425   cache &MAY; store an incomplete response message body if the cache entry is
426   recorded as incomplete. Likewise, a <x:ref>206 (Partial Content)</x:ref>
427   response &MAY; be stored as if it were an incomplete <x:ref>200
428   (OK)</x:ref> cache entry. However, a cache &MUST-NOT; store incomplete or
429   partial content responses if it does not support the <x:ref>Range</x:ref>
430   and <x:ref>Content-Range</x:ref> header fields or if it does not understand
431   the range units used in those fields.
[540]432</t>
433<t>
[1374]434   A cache &MAY; complete a stored incomplete response by making a subsequent
435   range request (&partial;) and combining the successful response with the
[1746]436   stored entry, as defined in <xref target="combining.responses"/>. A cache
437   &MUST-NOT; use an incomplete response to answer requests unless the
438   response has been made complete or the request is partial and specifies a
439   range that is wholly within the incomplete response. A cache &MUST-NOT;
440   send a partial response to a client without explicitly marking it as such
441   using the <x:ref>206 (Partial Content)</x:ref> status code.
[540]442</t>
443</section>
[8]444
445
[1751]446<section anchor="caching.authenticated.responses"
447   title="Storing Responses to Authenticated Requests">
448<t>
449   A shared cache &MUST-NOT; use a cached response to a request with an
450   <x:ref>Authorization</x:ref> header field (&header-authorization;) to
451   satisfy any subsequent request unless a cache directive that allows such
452   responses to be stored is present in the response.
453</t>
454<t>
455   In this specification, the following <x:ref>Cache-Control</x:ref> response
456   directives (<xref target="cache-response-directive"/>) have such an effect:
457   must-revalidate, public, s-maxage.
458</t>
459<t>
460   Note that cached responses that contain the "must-revalidate" and/or
461   "s-maxage" response directives are not allowed to be served stale (<xref
462   target="serving.stale.responses"/>) by shared caches. In particular, a
463   response with either "max-age=0, must-revalidate" or "s-maxage=0" cannot be
464   used to satisfy a subsequent request without revalidating it on the origin
465   server.
466</t>
467</section>
468</section>
469
470
[949]471<section anchor="constructing.responses.from.caches"
472   title="Constructing Responses from Caches">
[540]473<t>
[2052]474   For a presented request, a cache &MUST-NOT; send a stored response,
[949]475   unless:
476   <list style="symbols">
[965]477      <t>The presented effective request URI (&effective-request-uri;) and
[949]478      that of the stored response match, and</t>
479      <t>the request method associated with the stored response allows it to
480      be used for the presented request, and</t>
[1163]481      <t>selecting header fields nominated by the stored response (if any)
[949]482      match those presented (see <xref target="caching.negotiated.responses"
483      />), and</t>
[1483]484      <t>the presented request does not contain the no-cache pragma (<xref
485      target="header.pragma"/>), nor the no-cache cache directive (<xref
486      target="cache-request-directive"/>), unless the stored response is
487      successfully validated (<xref target="validation.model"/>), and</t>
488      <t>the stored response does not contain the no-cache cache directive
[1793]489      (<xref target="cache-response-directive.no-cache"/>), unless it is
490      successfully validated (<xref target="validation.model"/>), and</t>
[949]491      <t>the stored response is either:
492         <list style="symbols">
493            <t>fresh (see <xref target="expiration.model" />), or</t>
494            <t>allowed to be served stale (see <xref
495            target="serving.stale.responses" />), or</t>
496            <t>successfully validated (see <xref target="validation.model"
497            />).</t>
498         </list>
499      </t>
[540]500  </list>
501</t>
502<t>
[1292]503   Note that any of the requirements listed above can be overridden by a
[1291]504   cache-control extension; see <xref target="cache.control.extensions" />.
505</t>
506<t>
[949]507   When a stored response is used to satisfy a request without validation,
[2066]508   a cache &MUST; send a single <x:ref>Age</x:ref> header field
[1737]509   (<xref target="header.age"/>) in the response with a value equal to the
510   stored response's current_age; see <xref target="age.calculations" />.
[540]511</t>
512<t>
[1746]513   A cache &MUST; write through requests with methods that are unsafe
514   (&safe-methods;) to the origin server; i.e., a cache is not allowed to
515   generate a reply to such a request before having forwarded the request and
516   having received a corresponding response.
[540]517</t>
518<t>
[949]519   Also, note that unsafe requests might invalidate already stored responses;
520   see <xref target="invalidation.after.updates.or.deletions" />.
[540]521</t>
522<t>
[1277]523   When more than one suitable response is stored, a cache &MUST; use the
[1740]524   most recent response (as determined by the <x:ref>Date</x:ref> header
525   field). It can also forward a request with "Cache-Control: max-age=0" or
526   "Cache-Control: no-cache" to disambiguate which response to use.
[540]527</t>
[1044]528<t>
[1746]529   A cache that does not have a clock available &MUST-NOT; use stored
[2082]530   responses without revalidating them on every use.
[1044]531</t>
532
[8]533
[540]534<section anchor="expiration.model" title="Freshness Model">
535<t>
[949]536   When a response is "fresh" in the cache, it can be used to satisfy
537   subsequent requests without contacting the origin server, thereby improving
538   efficiency.
[540]539</t>
540<t>
[949]541   The primary mechanism for determining freshness is for an origin server to
[1746]542   provide an explicit expiration time in the future, using either the
543   <x:ref>Expires</x:ref> header field (<xref target="header.expires" />) or
544   the max-age response cache directive (<xref
[1793]545   target="cache-response-directive.max-age" />). Generally, origin servers will
[1746]546   assign future explicit expiration times to responses in the belief that the
547   representation is not likely to change in a semantically significant way
548   before the expiration time is reached.
[540]549</t>
550<t>
[949]551   If an origin server wishes to force a cache to validate every request, it
[969]552   can assign an explicit expiration time in the past to indicate that the
[1991]553   response is already stale. Compliant caches will normally validate a stale
[1113]554   cached response before reusing it for subsequent requests (see <xref
555   target="serving.stale.responses" />).
[540]556</t>
557<t>
[1746]558   Since origin servers do not always provide explicit expiration times, a
559   cache &MAY; assign a heuristic expiration time when an explicit time is not
560   specified, employing algorithms that use other header field values (such as
561   the <x:ref>Last-Modified</x:ref> time) to estimate a plausible expiration
562   time. This specification does not provide specific algorithms, but does
563   impose worst-case constraints on their results.
[540]564</t>
565<figure>
566<preamble>
[575]567  The calculation to determine if a response is fresh is:
[540]568</preamble>
569<artwork type="code">
[538]570   response_is_fresh = (freshness_lifetime &gt; current_age)
571</artwork>
[540]572</figure>
573<t>
[949]574   The freshness_lifetime is defined in <xref
575   target="calculating.freshness.lifetime" />; the current_age is defined in
576   <xref target="age.calculations" />.
[540]577</t>
578<t>
[2002]579   Clients can send the max-age or min-fresh cache directives in a request to
580   constrain or relax freshness calculations for the corresponding response
581   (<xref target="cache-request-directive" />).
[540]582</t>
583<t>
[949]584   Note that freshness applies only to cache operation; it cannot be used to
585   force a user agent to refresh its display or reload a resource. See <xref
586   target="history.lists" /> for an explanation of the difference between
587   caches and history mechanisms.
[540]588</t>
[8]589
[949]590<section anchor="calculating.freshness.lifetime"
591   title="Calculating Freshness Lifetime">
[540]592<t>
[949]593   A cache can calculate the freshness lifetime (denoted as
594   freshness_lifetime) of a response by using the first match of:
595   <list style="symbols">
596      <t>If the cache is shared and the s-maxage response cache directive
[1793]597      (<xref target="cache-response-directive.s-maxage" />) is present, use its value,
[949]598      or</t>
599      <t>If the max-age response cache directive (<xref
[1793]600      target="cache-response-directive.max-age" />) is present, use its value, or</t>
[1737]601      <t>If the <x:ref>Expires</x:ref> response header field
602      (<xref target="header.expires" />) is present, use its value minus the
[1740]603      value of the <x:ref>Date</x:ref> response header field, or</t>
[949]604      <t>Otherwise, no explicit expiration time is present in the response. A
605      heuristic freshness lifetime might be applicable; see <xref
606      target="heuristic.freshness" />.</t>
607   </list>
[540]608</t>
609<t>
[949]610   Note that this calculation is not vulnerable to clock skew, since all of
611   the information comes from the origin server.
[540]612</t>
[1731]613<t>
614   When there is more than one value present for a given directive (e.g., two
[1737]615   <x:ref>Expires</x:ref> header fields, multiple Cache-Control: max-age
616   directives), it is considered invalid. Caches are encouraged to consider
617   responses that have invalid freshness information to be stale.
[1731]618</t>
[1751]619</section>
[8]620
[540]621<section anchor="heuristic.freshness" title="Calculating Heuristic Freshness">
622<t>
[949]623   If no explicit expiration time is present in a stored response that has a
624   status code whose definition allows heuristic freshness to be used
[1746]625   (including the following in &status-codes;: <x:ref>200 (OK)</x:ref>,
626   <x:ref>203 (Non-Authoritative Information)</x:ref>, <x:ref>206 (Partial
627   Content)</x:ref>, <x:ref>300 (Multiple Choices)</x:ref>, <x:ref>301 (Moved
628   Permanently)</x:ref> and <x:ref>410 (Gone)</x:ref>), a cache &MAY;
629   calculate a heuristic expiration time. A cache &MUST-NOT; use heuristics to
630   determine freshness for responses with status codes that do not explicitly
631   allow it.
[540]632</t>
633<t>
[1737]634   When a heuristic is used to calculate freshness lifetime, a cache &SHOULD;
635   attach a <x:ref>Warning</x:ref> header field with a 113 warn-code to the
636   response if its current_age is more than 24 hours and such a warning is not
637   already present.
[540]638</t>
639<t>
[1739]640   Also, if the response has a <x:ref>Last-Modified</x:ref> header field
[1433]641   (&header-last-modified;), caches are encouraged to use a heuristic
642   expiration value that is no more than some fraction of the interval since
643   that time. A typical setting of this fraction might be 10%.
[540]644</t>
[828]645<x:note>
[949]646   <t>
[1755]647      &Note; <xref target="RFC2616" x:fmt="of" x:sec="13.9"/> prohibited caches
[1753]648      from calculating heuristic freshness for URIs with query components
649      (i.e., those containing '?'). In practice, this has not been widely
650      implemented. Therefore, servers are encouraged to send explicit
651      directives (e.g., Cache-Control: no-cache) if they wish to preclude
652      caching.
[949]653   </t>
[828]654</x:note>
[540]655</section>
[8]656
[540]657<section anchor="age.calculations" title="Calculating Age">
658<t>
[2082]659   The <x:ref>Age</x:ref> header field is used to convey an estimated
[1737]660   age of the response message when obtained from a cache. The Age field value
[2082]661   is the cache's estimate of the number of seconds since the response was
[1746]662   generated or validated by the origin server. In essence, the Age value is
663   the sum of the time that the response has been resident in each of the
664   caches along the path from the origin server, plus the amount of time it
665   has been in transit along network paths.
[540]666</t>
667<t>
[949]668   The following data is used for the age calculation:
[540]669</t>
670<t>
[949]671   <x:dfn>age_value</x:dfn>
672   <list>
673      <t>
[1737]674         The term "age_value" denotes the value of the <x:ref>Age</x:ref>
675         header field (<xref target="header.age"/>), in a form appropriate for
676         arithmetic operation; or 0, if not available.
[949]677      </t>
678   </list>
[540]679</t>
680<t>
[949]681   <x:dfn>date_value</x:dfn>
682   <list>
683      <t>
[2082]684         The term "date_value" denotes the value of
[1746]685         the Date header field, in a form appropriate for arithmetic
686         operations. See &header-date; for the definition of the Date header
687         field, and for requirements regarding responses without it.
[949]688      </t>
689   </list>
[540]690</t>
[575]691<t>
[949]692   <x:dfn>now</x:dfn>
693   <list>
694      <t>
695         The term "now" means "the current value of the clock at the host
[2082]696         performing the calculation". A host ought to use NTP (<xref
[1112]697         target="RFC1305"/>) or some similar protocol to synchronize its
[2082]698         clocks to Coordinated Universal Time.
[949]699      </t>
700   </list>
[779]701</t>
702<t>
[949]703   <x:dfn>request_time</x:dfn>
704   <list>
705      <t>
706         The current value of the clock at the host at the time the request
707         resulting in the stored response was made.
708      </t>
709   </list>
[779]710</t>
711<t>
[949]712   <x:dfn>response_time</x:dfn>
713   <list>
714      <t>
715         The current value of the clock at the host at the time the response
716         was received.
717      </t>
718   </list>
[779]719</t>
720<t>
[949]721   A response's age can be calculated in two entirely independent ways:
722   <list style="numbers">
723      <t>the "apparent_age": response_time minus date_value, if the local
724      clock is reasonably well synchronized to the origin server's clock. If
725      the result is negative, the result is replaced by zero.</t>
726      <t>the "corrected_age_value", if all of the caches along the response
[1112]727      path implement HTTP/1.1. A cache &MUST; interpret this value relative
[949]728      to the time the request was initiated, not the time that the response
729      was received.</t>
730   </list>
[540]731</t>
732<figure>
733<artwork type="code">
[786]734  apparent_age = max(0, response_time - date_value);
[792]735
[786]736  response_delay = response_time - request_time;
[792]737  corrected_age_value = age_value + response_delay; 
738</artwork>
739</figure>
740<figure>
[1484]741<preamble>These &SHOULD; be combined as</preamble>
[792]742<artwork type="code">
743  corrected_initial_age = max(apparent_age, corrected_age_value);
[540]744</artwork></figure>
745<t>
[1737]746   unless the cache is confident in the value of the <x:ref>Age</x:ref> header
[1741]747   field (e.g., because there are no HTTP/1.0 hops in the <x:ref>Via</x:ref>
748   header field), in which case the corrected_age_value &MAY; be used as the
[1737]749   corrected_initial_age.</t>
[1484]750<t>
[949]751   The current_age of a stored response can then be calculated by adding the
752   amount of time (in seconds) since the stored response was last validated by
753   the origin server to the corrected_initial_age.
[540]754</t>
[786]755<figure><artwork type="code">
[540]756  resident_time = now - response_time;
[786]757  current_age = corrected_initial_age + resident_time;
[540]758</artwork></figure>
[1390]759<t>
[1418]760   Additionally, to avoid common problems in date parsing:
[1390]761</t>
762<t>
763  <list style="symbols">
764     <t>Although all date formats are specified to be case-sensitive,
[2082]765        cache recipients &SHOULD; match day, week and timezone names
[1390]766        case-insensitively.</t>
767             
[2082]768     <t>If a cache recipient's internal implementation of time has less
769        resolution than the value of an HTTP-date, the recipient &MUST;
770        internally represent a parsed <x:ref>Expires</x:ref> date as the
771        nearest time equal to or earlier than the received value.</t>
[1390]772
[2082]773     <t>Cache recipients &MUST-NOT; allow local time zones to influence the
774        calculation or comparison of an age or expiration time.</t>
[1390]775
[2082]776     <t>Cache recipients &SHOULD; consider a date with a zone abbreviation
777        other than "GMT" to be invalid for calculating expiration.</t>
[1390]778  </list>
779</t>
[540]780</section>
[8]781
[540]782<section anchor="serving.stale.responses" title="Serving Stale Responses">
783<t>
[949]784   A "stale" response is one that either has explicit expiry information or is
785   allowed to have heuristic expiry calculated, but is not fresh according to
786   the calculations in <xref target="expiration.model" />.
[540]787</t>
788<t>
[2052]789   A cache &MUST-NOT; send a stale response if it is prohibited by an
[949]790   explicit in-protocol directive (e.g., by a "no-store" or "no-cache" cache
791   directive, a "must-revalidate" cache-response-directive, or an applicable
792   "s-maxage" or "proxy-revalidate" cache-response-directive; see <xref
793   target="cache-response-directive"/>).
[540]794</t>
795<t>
[2052]796   A cache &MUST-NOT; send stale responses unless it is disconnected
[949]797   (i.e., it cannot contact the origin server or otherwise find a forward
[1264]798   path) or doing so is explicitly allowed (e.g., by the max-stale request
[949]799   directive; see <xref target="cache-request-directive" />).
[540]800</t>
801<t>
[1737]802   A cache &SHOULD; append a <x:ref>Warning</x:ref> header field with the 110
803   warn-code (see <xref target="header.warning"/>) to stale responses.
804   Likewise, a cache &SHOULD; add the 112 warn-code to stale responses if the
805   cache is disconnected.
[540]806</t>
807<t>
[949]808   If a cache receives a first-hand response (either an entire response, or a
[1746]809   <x:ref>304 (Not Modified)</x:ref> response) that it would normally forward
810   to the requesting client, and the received response is no longer fresh, the
811   cache can forward it to the requesting client without adding a new
812   <x:ref>Warning</x:ref> (but without removing any existing Warning header
813   fields). A cache shouldn't attempt to validate a response simply because
814   that response became stale in transit.
[540]815</t>
816</section>
817</section>
[8]818
[540]819<section anchor="validation.model" title="Validation Model">
820<t>
[949]821   When a cache has one or more stored responses for a requested URI, but
822   cannot serve any of them (e.g., because they are not fresh, or one cannot
823   be selected; see <xref target="caching.negotiated.responses"/>), it can use
824   the conditional request mechanism &conditional; in the forwarded request to
825   give the origin server an opportunity to both select a valid stored
826   response to be used, and to update it. This process is known as
827   "validating" or "revalidating" the stored response.
[540]828</t>
829<t>
[1739]830   When sending such a conditional request, a cache adds an
831   <x:ref>If-Modified-Since</x:ref> header field whose value is that of the
832   <x:ref>Last-Modified</x:ref> header field from the selected
833   (see <xref target="caching.negotiated.responses"/>) stored response, if
834   available.
[540]835</t>
836<t>
[1739]837   Additionally, a cache can add an <x:ref>If-None-Match</x:ref> header field
838   whose value is that of the <x:ref>ETag</x:ref> header field(s) from all
839   responses stored for the requested URI, if present. However, if any of the
840   stored responses contains only partial content, the cache shouldn't
841   include its entity-tag in the If-None-Match header field unless the request
842   is for a range that would be fully satisfied by that stored response.
[607]843</t>
[1419]844
[1746]845<t>Cache handling of a response to a conditional request is dependent upon its
846status code:</t>
[1419]847
[607]848<t>
[1419]849   <list style="symbols">
850      <t>
[1746]851         A <x:ref>304 (Not Modified)</x:ref> response status code indicates
852         that the stored response can be updated and reused; see <xref
[1419]853         target="freshening.responses"/>.
854      </t>
855      <t>
[1910]856         A full response (i.e., one with a payload body) indicates that none
[1419]857         of the stored responses nominated in the conditional request is
[1433]858         suitable. Instead, the cache can use the full response to
859         satisfy the request and &MAY; replace the stored response(s).
[1419]860      </t>
861      <t>
[1735]862         However, if a cache receives a <x:ref>5xx (Server Error)</x:ref>
863         response while attempting to validate a response, it can either
864         forward this response to the requesting client, or act as if the
[2052]865         server failed to respond. In the latter case, it can send a
[1746]866         previously stored response (see <xref
867         target="serving.stale.responses" />).
[1419]868      </t>
869   </list>
[540]870</t>
[1419]871
[1554]872<section anchor="freshening.responses" title="Freshening Responses with 304 Not Modified">
[540]873<t>
[1746]874   When a cache receives a <x:ref>304 (Not Modified)</x:ref> response and
875   already has one or more stored <x:ref>200 (OK)</x:ref> responses for the
876   same cache key, the cache needs to identify which of the stored responses
877   are updated by this new response and then update the stored response(s)
878   with the new information provided in the <x:ref>304</x:ref> response.
[2100]879</t>
880<t>
881   The stored response to update is identified by using the first match (if
882   any) of:
[1419]883   <list style="symbols">
884    <t>
885     If the new response contains a strong validator, then that strong
886     validator identifies the selected representation.  All of the stored
887     responses with the same strong validator are selected.
[1995]888     If none of the stored responses contain the same strong validator,
889     then the new response &MUST-NOT; be used to update any stored responses.
[1419]890    </t>
891    <t>
892     If the new response contains a weak validator and that validator
893     corresponds to one of the cache's stored responses, then the most
894     recent of those matching stored responses is selected.
895    </t>
896    <t>
[2100]897     If the new response does not include any form of validator (such as in
898     the case where a client generates an If-Modified-Since request from a
899     source other than the Last-Modified response header field), and there is
[1419]900     only one stored response, and that stored response also lacks a
901     validator, then that stored response is selected.
902    </t>
903   </list>
[540]904</t>
905<t>
[1419]906   If a stored response is selected for update, the cache &MUST;:
907   <list style="symbols">
[1737]908      <t>delete any <x:ref>Warning</x:ref> header fields in the stored response
909         with warn-code 1xx (see <xref target="header.warning" />);</t>
910      <t>retain any <x:ref>Warning</x:ref> header fields in the stored response
911         with warn-code 2xx; and,</t>
[1734]912      <t>use other header fields provided in the <x:ref>304 (Not Modified)</x:ref>
913         response to replace all instances of the corresponding header
914         fields in the stored response.</t>
[1419]915   </list>
[540]916</t>
917</section>
[8]918
[1419]919</section>
920
[949]921<section anchor="caching.negotiated.responses"
[1751]922   title="Using Negotiated Responses">
[540]923<t>
[949]924   When a cache receives a request that can be satisfied by a stored response
[1860]925   that has a <x:ref>Vary</x:ref> header field (&header-vary;),
[1737]926   it &MUST-NOT; use that response unless all of the selecting header fields
[1746]927   nominated by the Vary header field match in both the original request
928   (i.e., that associated with the stored response), and the presented
929   request.
[540]930</t>
931<t>
[1163]932   The selecting header fields from two requests are defined to match if and
[949]933   only if those in the first request can be transformed to those in the
934   second request by applying any of the following:
935   <list style="symbols">
936      <t>
[1746]937         adding or removing whitespace, where allowed in the header field's
938         syntax
[949]939      </t>
940      <t>
[1163]941         combining multiple header fields with the same field name
[949]942         (see &header-fields;)
943      </t>
944      <t>
[994]945         normalizing both header field values in a way that is known to have
[1746]946         identical semantics, according to the header field's specification
947         (e.g., re-ordering field values when order is not significant;
[949]948         case-normalization, where values are defined to be case-insensitive)
949      </t>
[771]950  </list>
[540]951</t>
952<t>
[949]953   If (after any normalization that might take place) a header field is absent
954   from a request, it can only match another request if it is also absent
955   there.
[607]956</t>
957<t>
[1737]958   A <x:ref>Vary</x:ref> header field-value of "*" always fails to match, and
959   subsequent requests to that resource can only be properly interpreted by the
960   origin server.
[540]961</t>
962<t>
[1163]963   The stored response with matching selecting header fields is known as the
[949]964   selected response.
[540]965</t>
966<t>
[1292]967   If multiple selected responses are available, the most recent response
[1740]968   (as determined by the <x:ref>Date</x:ref> header field) is used; see <xref
[1292]969   target="constructing.responses.from.caches"/>.
[1289]970</t>
971<t>
[1995]972   If no selected response is available, the cache cannot satisfy the
973   presented request. Typically, it is forwarded to the origin server
974   in a (possibly conditional; see <xref target="validation.model"/>) request.
[540]975</t>
976</section>
[8]977
[1751]978
[1374]979<section anchor="combining.responses" title="Combining Partial Content">
[540]980<t>
[1374]981   A response might transfer only a partial representation if the
982   connection closed prematurely or if the request used one or more Range
983   specifiers (&partial;).  After several such transfers, a cache might have
984   received several ranges of the same representation.  A cache &MAY; combine
985   these ranges into a single stored response, and reuse that response to
986   satisfy later requests, if they all share the same strong validator and
987   the cache complies with the client requirements in &combining-byte-ranges;.
[540]988</t>
989<t>
[1374]990   When combining the new response with one or more stored responses, a
991   cache &MUST;:
992   <list style="symbols">
[1737]993      <t>delete any <x:ref>Warning</x:ref> header fields in the stored response
994         with warn-code 1xx (see <xref target="header.warning" />);</t>
995      <t>retain any <x:ref>Warning</x:ref> header fields in the stored response
996         with warn-code 2xx; and,</t>
[1374]997      <t>use other header fields provided in the new response, aside
[1738]998         from <x:ref>Content-Range</x:ref>, to replace all instances of the
999         corresponding header fields in the stored response.</t>
[1374]1000   </list>
[540]1001</t>
[1374]1002</section>
[1751]1003</section>
[1374]1004
[8]1005
[1751]1006<section anchor="head.effects" title="Updating Caches with HEAD Responses">
1007<t>
1008   A response to the HEAD method is identical to what an equivalent request
1009   made with a GET would have been, except it lacks a body. This property
1010   of HEAD responses is used to both invalidate and update cached GET
1011   responses.
1012</t>
1013<t>
1014   If one or more stored GET responses can be selected (as per <xref
1015   target="caching.negotiated.responses"/>) for a HEAD request, and the
1016   <x:ref>Content-Length</x:ref>, <x:ref>ETag</x:ref> or
1017   <x:ref>Last-Modified</x:ref> value of a HEAD response differs from that in a
1018   selected GET response, the cache &MUST; consider that selected response to
1019   be stale.
1020</t>
1021<t>
1022   If the <x:ref>Content-Length</x:ref>, <x:ref>ETag</x:ref> and
1023   <x:ref>Last-Modified</x:ref> values of a HEAD response (when present) are
1024   the same as that in a selected GET response (as per
1025   <xref target="caching.negotiated.responses"/>), the cache &SHOULD; update
[1772]1026   the remaining header fields in the stored response using the following
1027   rules:
[1751]1028   <list style="symbols">
1029      <t>delete any <x:ref>Warning</x:ref> header fields in the stored response
1030         with warn-code 1xx (see <xref target="header.warning" />);</t>
1031      <t>retain any <x:ref>Warning</x:ref> header fields in the stored response
1032         with warn-code 2xx; and,</t>
1033      <t>use other header fields provided in the response to replace
1034         all instances of the corresponding header fields in the stored
1035         response.</t>
1036   </list>
1037</t>
1038
[540]1039</section>
[8]1040
[1751]1041
1042<section anchor="invalidation.after.updates.or.deletions"
1043   title="Request Methods that Invalidate">
1044<t>
1045   Because unsafe request methods (&safe-methods;) such as PUT, POST or DELETE
1046   have the potential for changing state on the origin server, intervening
1047   caches can use them to keep their contents up-to-date.
1048</t>
1049<t>
1050   A cache &MUST; invalidate the effective Request URI
1051   (&effective-request-uri;) as well as the URI(s) in the
1052   <x:ref>Location</x:ref> and <x:ref>Content-Location</x:ref> response header
1053   fields (if present) when a non-error response to a request with an unsafe
1054   method is received.
1055</t>
1056<t>
1057   However, a cache &MUST-NOT; invalidate a URI from a <x:ref>Location</x:ref>
1058   or <x:ref>Content-Location</x:ref> response header field if the host part of
1059   that URI differs from the host part in the effective request URI
1060   (&effective-request-uri;). This helps prevent denial of service attacks.
1061</t>
1062<t>
1063   A cache &MUST; invalidate the effective request URI
1064   (&effective-request-uri;) when it receives a non-error response
1065   to a request with a method whose safety is unknown.
1066</t>
1067<t>
1068   Here, a "non-error response" is one with a <x:ref>2xx (Successful)</x:ref>
1069   or <x:ref>3xx (Redirection)</x:ref> status code. "Invalidate" means that
1070   the cache will either remove all stored responses related to the effective
1071   request URI, or will mark these as "invalid" and in need of a mandatory
[2052]1072   validation before they can be sent in response to a subsequent request.
[1751]1073</t>
1074<t>
1075   Note that this does not guarantee that all appropriate responses are
1076   invalidated. For example, the request that caused the change at the origin
1077   server might not have gone through the cache where a response is stored.
1078</t>
1079</section>
1080
1081
1082
1083
[1415]1084<section anchor="header.field.definitions" title="Header Field Definitions">
[575]1085<t>
[949]1086   This section defines the syntax and semantics of HTTP/1.1 header fields
1087   related to caching.
[575]1088</t>
[8]1089
[540]1090<section anchor="header.age" title="Age">
[1120]1091   <iref item="Age header field" primary="true" x:for-anchor="" />
[949]1092   <x:anchor-alias value="Age"/>
1093   <x:anchor-alias value="age-value"/>
[540]1094<t>
[1163]1095   The "Age" header field conveys the sender's estimate of the amount
[949]1096   of time since the response was generated or successfully validated at the
1097   origin server. Age values are calculated as specified in <xref
1098   target="age.calculations" />.
[540]1099</t>
[1231]1100<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Age"/>
1101  <x:ref>Age</x:ref> = <x:ref>delta-seconds</x:ref>
[8]1102</artwork></figure>
[540]1103<t>
[1323]1104  Age field-values are non-negative integers, representing time in seconds
1105  (see <xref target="delta-seconds"/>).
[540]1106</t>
1107<t>
[949]1108   The presence of an Age header field in a response implies that a response
1109   is not first-hand. However, the converse is not true, since HTTP/1.0 caches
1110   might not implement the Age header field.
[540]1111</t>
1112</section>
[8]1113
[540]1114<section anchor="header.cache-control" title="Cache-Control">
[1120]1115   <iref item="Cache-Control header field" primary="true" x:for-anchor="" />
[949]1116   <x:anchor-alias value="Cache-Control"/>
1117   <x:anchor-alias value="cache-directive"/>
[540]1118<t>
[1163]1119   The "Cache-Control" header field is used to specify directives for
[949]1120   caches along the request/response chain. Such cache directives are
1121   unidirectional in that the presence of a directive in a request does not
1122   imply that the same directive is to be given in the response.
[540]1123</t>
[827]1124<t>
[1112]1125   A cache &MUST; obey the requirements of the Cache-Control
[949]1126   directives defined in this section. See <xref
1127   target="cache.control.extensions"/> for information about how Cache-Control
1128   directives defined elsewhere are handled.
[827]1129</t>
[540]1130<x:note>
[949]1131   <t>
[1692]1132       &Note; HTTP/1.0 caches might not implement Cache-Control and
[949]1133       might only implement Pragma: no-cache (see <xref target="header.pragma"
1134       />).
1135   </t>
[540]1136</x:note>
1137<t>
[1173]1138   A proxy, whether or not it implements a cache, &MUST; pass cache directives
1139   through in forwarded messages, regardless of their
[1112]1140   significance to that application, since the directives might be applicable
1141   to all recipients along the request/response chain. It is not possible to
1142   target a directive to a specific cache.
[540]1143</t>
[1695]1144<t>
1145   Cache directives are identified by a token, to be compared case-insensitively,
1146   and have an optional argument, that can use both token and quoted-string
1147   syntax. For the directives defined below that define arguments, recipients
1148   ought to accept both forms, even if one is documented to be preferred. For
1149   any directive not defined by this specification, recipients &MUST; accept
1150   both forms.
1151</t>
1152<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Cache-Control"/><iref primary="true" item="Grammar" subitem="cache-directive"/>
[1231]1153  <x:ref>Cache-Control</x:ref>   = 1#<x:ref>cache-directive</x:ref>
[8]1154
[1695]1155  <x:ref>cache-directive</x:ref> = <x:ref>token</x:ref> [ "=" ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> ) ]
[8]1156</artwork></figure>
[1695]1157<t>
1158   For the cache directives defined below, no argument is defined (nor allowed)
1159   otherwise stated otherwise.
1160</t>
[8]1161
[1779]1162<section title="Request Cache-Control Directives" anchor="cache-request-directive">
[8]1163
[1695]1164<section title="no-cache" anchor="cache-request-directive.no-cache">
[1896]1165   <iref item="no-cache (cache directive)" primary="true" />
[1695]1166<t>
[1779]1167   The "no-cache" request directive indicates that a cache &MUST-NOT;
[1695]1168   use a stored response to satisfy the request without successful
1169   validation on the origin server.
[540]1170</t>
[1695]1171</section>
1172 
1173<section title="no-store" anchor="cache-request-directive.no-store">
[1896]1174   <iref item="no-store (cache directive)" primary="true" />
[1695]1175<t>
[1779]1176   The "no-store" request directive indicates that a cache &MUST-NOT;
[1695]1177   store any part of either this request or any response to it. This
1178   directive applies to both private and shared caches. "&MUST-NOT;
1179   store" in this context means that the cache &MUST-NOT; intentionally
1180   store the information in non-volatile storage, and &MUST; make a
1181   best-effort attempt to remove the information from volatile storage as
1182   promptly as possible after forwarding it.
[540]1183</t>
1184<t>
[1695]1185   This directive is NOT a reliable or sufficient mechanism for ensuring
1186   privacy. In particular, malicious or compromised caches might not
1187   recognize or obey this directive, and communications networks might be
1188   vulnerable to eavesdropping.
1189</t>
1190<t>
1191   Note that if a request containing this directive is satisfied from a
1192   cache, the no-store request directive does not apply to the already
1193   stored response.
1194</t>
1195</section>
1196
1197<section title="max-age" anchor="cache-request-directive.max-age">
[1896]1198   <iref item="max-age (cache directive)" primary="true" />
[1695]1199<t>
1200   Argument syntax:
[949]1201   <list>
[1695]1202      <t>
1203        <x:ref>delta-seconds</x:ref> (see <xref target="delta-seconds"/>)
1204      </t>
[949]1205   </list>
[540]1206</t>
1207<t>
[1779]1208   The "max-age" request directive indicates that the client is unwilling to
[1695]1209   accept a response whose age is greater than the specified number of
1210   seconds. Unless the max-stale request directive is also present, the
1211   client is not willing to accept a stale response.
1212</t>
1213<t>
1214   &Note; This directive uses the token form of the argument syntax;
1215   e.g., 'max-age=5', not 'max-age="5"'. Senders &SHOULD-NOT; use the
1216   quoted-string form.
1217</t>
1218</section>
1219
1220<section title="max-stale" anchor="cache-request-directive.max-stale">
[1896]1221   <iref item="max-stale (cache directive)" primary="true" />
[1695]1222<t>
1223   Argument syntax:
[949]1224   <list>
[1695]1225      <t>
1226        <x:ref>delta-seconds</x:ref> (see <xref target="delta-seconds"/>)
1227      </t>
[949]1228   </list>
[540]1229</t>
1230<t>
[1779]1231   The "max-stale" request directive indicates that the client is willing
[1695]1232   to accept a response that has exceeded its expiration time. If max-stale
1233   is assigned a value, then the client is willing to accept a response
1234   that has exceeded its expiration time by no more than the specified
1235   number of seconds. If no value is assigned to max-stale, then the client
1236   is willing to accept a stale response of any age.
1237</t>
1238<t>
1239   &Note; This directive uses the token form of the argument syntax;
1240   e.g., 'max-stale=10', not 'max-stale="10"'. Senders &SHOULD-NOT; use the
1241   quoted-string form.
1242</t>
1243</section>
1244
1245<section title="min-fresh" anchor="cache-request-directive.min-fresh">
[1896]1246   <iref item="min-fresh (cache directive)" primary="true" />
[1695]1247<t>
1248   Argument syntax:
[949]1249   <list>
[1695]1250      <t>
1251        <x:ref>delta-seconds</x:ref> (see <xref target="delta-seconds"/>)
1252      </t>
[949]1253   </list>
[540]1254</t>
1255<t>
[1779]1256   The "min-fresh" request directive indicates that the client is willing
[1695]1257   to accept a response whose freshness lifetime is no less than its
1258   current age plus the specified time in seconds. That is, the client
1259   wants a response that will still be fresh for at least the specified
1260   number of seconds.
1261</t>
1262<t>
1263   &Note; This directive uses the token form of the argument syntax;
1264   e.g., 'min-fresh=20', not 'min-fresh="20"'. Senders &SHOULD-NOT; use the
1265   quoted-string form.
1266</t>
1267</section>
1268
1269<section title="no-transform" anchor="cache-request-directive.no-transform">
[1896]1270   <iref item="no-transform (cache directive)" primary="true" />
[1695]1271<t>
[1779]1272   The "no-transform" request directive indicates that an intermediary
[2041]1273   (whether or not it implements a cache) &MUST-NOT; transform the payload,
1274   as defined in &transformations;.
[540]1275</t>
[1695]1276</section>
1277
1278<section title="only-if-cached" anchor="cache-request-directive.only-if-cached">
[1896]1279   <iref item="only-if-cached (cache directive)" primary="true" />
[1695]1280<t>
[1779]1281   The "only-if-cached" request directive indicates that the client only wishes
[1775]1282   to obtain a stored response. If it receives this directive, a cache &SHOULD;
1283   either respond using a stored response that is consistent with the other
[1746]1284   constraints of the request, or respond with a <x:ref>504 (Gateway
1285   Timeout)</x:ref> status code. If a group of caches is being operated as a
1286   unified system with good internal connectivity, a member cache &MAY;
[1695]1287   forward such a request within that group of caches.
[540]1288</t>
1289</section>
[1695]1290</section>
[8]1291
[949]1292<section anchor="cache-response-directive"
1293   title="Response Cache-Control Directives">
1294   <x:anchor-alias value="cache-response-directive" />
[8]1295
[2020]1296<section title="public" anchor="cache-response-directive.public">
[1896]1297   <iref item="public (cache directive)" primary="true" />
[1695]1298<t>
[1779]1299   The "public" response directive indicates that a response whose
[1695]1300   associated request contains an 'Authentication' header &MAY; be
1301   stored (see <xref target="caching.authenticated.responses" />).
[540]1302</t>
[1695]1303</section>
1304
1305<section title="private" anchor="cache-response-directive.private">
[1896]1306   <iref item="private (cache directive)" primary="true" />
[1695]1307<t>
1308   Argument syntax:
[949]1309   <list>
[1695]1310      <t>
1311        #<x:ref>field-name</x:ref>
[1664]1312      </t>
[949]1313   </list>
[540]1314</t>
1315<t>
[1779]1316   The "private" response directive indicates that the response message is
[1695]1317   intended for a single user and &MUST-NOT; be stored by a shared cache. A
1318   private cache &MAY; store the response.
1319</t>
1320<t>
1321   If the private response directive specifies one or more field-names,
1322   this requirement is limited to the field-values associated with the
1323   listed response header fields. That is, a shared cache &MUST-NOT; store
1324   the specified field-names(s), whereas it &MAY; store the remainder of the
1325   response message.
1326</t>
1327<t>
1328   The field-names given are not limited to the set of standard header
1329   fields defined by this specification. Field names are case-insensitive.
1330</t>
1331<t>
1332   &Note; This usage of the word "private" only controls
1333   where the response can be stored; it cannot ensure the privacy of the
1334   message content. Also, private response directives with field-names are
1335   often handled by implementations as if an unqualified private directive
1336   was received; i.e., the special handling for the qualified form is not
1337   widely implemented.
1338</t>
1339<t>
[1746]1340   &Note; This directive uses the quoted-string form of the argument syntax.
1341   Senders &SHOULD-NOT; use the token form (even if quoting appears not to be
1342   needed for single-entry lists).
[1695]1343</t>
1344</section>
1345
1346<section title="no-cache" anchor="cache-response-directive.no-cache">
[1896]1347   <iref item="no-cache (cache directive)" primary="true" />
[1695]1348<t>
1349   Argument syntax:
[949]1350   <list>
[1695]1351      <t>
1352        #<x:ref>field-name</x:ref>
[1664]1353      </t>
[949]1354   </list>
[540]1355</t>
1356<t>
[1779]1357   The "no-cache" response directive indicates that the response &MUST-NOT;
[1695]1358   be used to satisfy a subsequent request without successful validation on
1359   the origin server. This allows an origin server to prevent a cache from
1360   using it to satisfy a request without contacting it, even by caches that
[2052]1361   have been configured to send stale responses.
[1695]1362</t>
1363<t>
1364   If the no-cache response directive specifies one or more field-names,
1365   then a cache &MAY; use the response to satisfy a subsequent request,
1366   subject to any other restrictions on caching. However, any header fields
1367   in the response that have the field-name(s) listed &MUST-NOT; be sent
1368   in the response to a subsequent request without successful revalidation
1369   with the origin server. This allows an origin server to prevent the
1370   re-use of certain header fields in a response, while still allowing
1371   caching of the rest of the response.
1372</t>
1373<t>
1374   The field-names given are not limited to the set of standard header
1375   fields defined by this specification. Field names are case-insensitive.
1376</t>
1377<t>
[1752]1378   &Note; Many HTTP/1.0 caches will not recognize or obey
[1695]1379   this directive. Also, no-cache response directives with field-names are
1380   often handled by implementations as if an unqualified no-cache directive
1381   was received; i.e., the special handling for the qualified form is not
1382   widely implemented.
1383</t>
1384<t>
[1746]1385   &Note; This directive uses the quoted-string form of the argument syntax.
1386   Senders &SHOULD-NOT; use the token form (even if quoting appears not to be
1387   needed for single-entry lists).
[1695]1388</t>
1389</section>
1390
1391<section title="no-store" anchor="cache-response-directive.no-store">
[1896]1392   <iref item="no-store (cache directive)" primary="true" />
[1695]1393<t>
[1779]1394   The "no-store" response directive indicates that a cache &MUST-NOT;
[1695]1395   store any part of either the immediate request or response. This
1396   directive applies to both private and shared caches. "&MUST-NOT;
1397   store" in this context means that the cache &MUST-NOT; intentionally
1398   store the information in non-volatile storage, and &MUST; make a
1399   best-effort attempt to remove the information from volatile storage as
1400   promptly as possible after forwarding it.
[540]1401</t>
1402<t>
[1695]1403   This directive is NOT a reliable or sufficient mechanism for ensuring
1404   privacy. In particular, malicious or compromised caches might not
1405   recognize or obey this directive, and communications networks might be
1406   vulnerable to eavesdropping.
1407</t>
1408</section>
1409
1410<section title="must-revalidate" anchor="cache-response-directive.must-revalidate">
[1896]1411   <iref item="must-revalidate (cache directive)" primary="true" />
[1695]1412<t>
[1779]1413   The "must-revalidate" response directive indicates that once it has
[1695]1414   become stale, a cache &MUST-NOT; use the response to satisfy subsequent
1415   requests without successful validation on the origin server.
[540]1416</t>
1417<t>
[1695]1418   The must-revalidate directive is necessary to support reliable
1419   operation for certain protocol features. In all circumstances a
1420   cache &MUST; obey the must-revalidate directive; in particular,
1421   if a cache cannot reach the origin server for any reason, it &MUST;
[1710]1422   generate a <x:ref>504 (Gateway Timeout)</x:ref> response.
[1695]1423</t>
1424<t>
1425   The must-revalidate directive ought to be used by servers if and only
1426   if failure to validate a request on the representation could result in
1427   incorrect operation, such as a silently unexecuted financial
1428   transaction.
1429</t>
1430</section>
1431
1432<section title="proxy-revalidate" anchor="cache-response-directive.proxy-revalidate">
[1896]1433   <iref item="proxy-revalidate (cache directive)" primary="true" />
[1695]1434<t>
[1779]1435   The "proxy-revalidate" response directive has the same meaning as the
[1695]1436   must-revalidate response directive, except that it does not apply to
1437   private caches.
[540]1438</t>
[1695]1439</section>
1440
1441<section title="max-age" anchor="cache-response-directive.max-age">
[1896]1442   <iref item="max-age (cache directive)" primary="true" />
[1695]1443<t>
1444   Argument syntax:
[949]1445   <list>
[1695]1446      <t>
1447        <x:ref>delta-seconds</x:ref> (see <xref target="delta-seconds"/>)
1448      </t>
[949]1449   </list>
[540]1450</t>
1451<t>
[1779]1452   The "max-age" response directive indicates that the response is to be
[1695]1453   considered stale after its age is greater than the specified number of
1454   seconds.
1455</t>
1456<t>
1457   &Note; This directive uses the token form of the argument syntax;
1458   e.g., 'max-age=5', not 'max-age="5"'. Senders &SHOULD-NOT; use the
1459   quoted-string form.
1460</t>
1461</section>     
1462
1463<section title="s-maxage" anchor="cache-response-directive.s-maxage">
[1896]1464   <iref item="s-maxage (cache directive)" primary="true" />
[1695]1465<t>
1466   Argument syntax:
[949]1467   <list>
[1695]1468      <t>
1469        <x:ref>delta-seconds</x:ref> (see <xref target="delta-seconds"/>)
1470      </t>
[949]1471   </list>
[540]1472</t>
1473<t>
[1779]1474   The "s-maxage" response directive indicates that, in shared caches, the
[1695]1475   maximum age specified by this directive overrides the maximum age
[1737]1476   specified by either the max-age directive or the <x:ref>Expires</x:ref>
1477   header field. The s-maxage directive also implies the semantics of the
1478   proxy-revalidate response directive.
[1695]1479</t>
1480<t>
1481   &Note; This directive uses the token form of the argument syntax;
1482   e.g., 's-maxage=10', not 's-maxage="10"'. Senders &SHOULD-NOT; use the
1483   quoted-string form.
1484</t>
1485</section>
1486
1487<section title="no-transform" anchor="cache-response-directive.no-transform">
[1896]1488   <iref item="no-transform (cache directive)" primary="true" />
[1695]1489<t>
[1779]1490   The "no-transform" response directive indicates that an intermediary
[2041]1491   (regardless of whether it implements a cache) &MUST-NOT; transform the
1492   payload, as defined in &transformations;.
[540]1493</t>
[1695]1494</section>
[8]1495
[540]1496</section>
[8]1497
[540]1498<section anchor="cache.control.extensions" title="Cache Control Extensions">
1499<t>
[949]1500   The Cache-Control header field can be extended through the use of one or
1501   more cache-extension tokens, each with an optional value. Informational
1502   extensions (those that do not require a change in cache behavior) can be
1503   added without changing the semantics of other directives. Behavioral
1504   extensions are designed to work by acting as modifiers to the existing base
1505   of cache directives. Both the new directive and the standard directive are
1506   supplied, such that applications that do not understand the new directive
1507   will default to the behavior specified by the standard directive, and those
1508   that understand the new directive will recognize it as modifying the
1509   requirements associated with the standard directive. In this way,
1510   extensions to the cache-control directives can be made without requiring
1511   changes to the base protocol.
[540]1512</t>
1513<t>
[949]1514   This extension mechanism depends on an HTTP cache obeying all of the
1515   cache-control directives defined for its native HTTP-version, obeying
1516   certain extensions, and ignoring all directives that it does not
1517   understand.
[540]1518</t>
1519<t>
[949]1520   For example, consider a hypothetical new response directive called
1521   "community" that acts as a modifier to the private directive. We define
[1112]1522   this new directive to mean that, in addition to any private cache, any
[949]1523   cache that is shared only by members of the community named within its
[1707]1524   value is allowed to cache the response. An origin server wishing to allow
1525   the UCI community to use an otherwise private response in their shared
1526   cache(s) could do so by including
[540]1527</t>
1528<figure><artwork type="example">
[458]1529  Cache-Control: private, community="UCI"
[540]1530</artwork></figure>
1531<t>
[949]1532   A cache seeing this header field will act correctly even if the cache does
1533   not understand the community cache-extension, since it will also see and
1534   understand the private directive and thus default to the safe behavior.
[540]1535</t>
1536<t>
[1285]1537   A cache &MUST; ignore unrecognized cache directives; it is assumed that any
[949]1538   cache directive likely to be unrecognized by an HTTP/1.1 cache will be
1539   combined with standard directives (or the response's default cacheability)
1540   such that the cache behavior will remain minimally correct even if the
1541   cache does not understand the extension(s).
[540]1542</t>
[817]1543<t>
[1701]1544   New extension directives ought to consider defining:
1545</t>
1546<t>
1547   <list style="symbols">
1548      <t>What it means for a directive to be specified multiple times,</t>
1549      <t>When the directive does not take an argument, what it means when an
1550      argument is present,</t>
1551      <t>When the directive requires an argument, what it means when it is
1552      missing.</t>
1553   </list>
1554</t>
1555<t>
[949]1556   The HTTP Cache Directive Registry defines the name space for the cache
1557   directives.
[817]1558</t>
1559<t>
[1112]1560   A registration &MUST; include the following fields:
[949]1561   <list style="symbols">
1562      <t>Cache Directive Name</t>
1563      <t>Pointer to specification text</t>
1564   </list>
[817]1565</t>
1566<t>
[1567]1567   Values to be added to this name space require IETF Review (see <xref
[949]1568   target="RFC5226" x:fmt="," x:sec="4.1"/>).
[817]1569</t>
1570<t>
[949]1571   The registry itself is maintained at <eref
1572   target="http://www.iana.org/assignments/http-cache-directives"/>.
[817]1573</t>
[540]1574</section>
[8]1575
[540]1576</section>
[538]1577
[540]1578<section anchor="header.expires" title="Expires">
[1120]1579   <iref item="Expires header field" primary="true" x:for-anchor="" />
[949]1580   <x:anchor-alias value="Expires"/>
[540]1581<t>
[965]1582   The "Expires" header field gives the date/time after which the
[949]1583   response is considered stale. See <xref target="expiration.model" /> for
1584   further discussion of the freshness model.
[540]1585</t>
1586<t>
[949]1587   The presence of an Expires field does not imply that the original resource
1588   will change or cease to exist at, before, or after that time.
[540]1589</t>
1590<t>
[2082]1591   The Expires value is an HTTP-date timestamp, as defined in &http-date;.
[540]1592</t>
[1231]1593<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Expires"/>
1594  <x:ref>Expires</x:ref> = <x:ref>HTTP-date</x:ref>
[8]1595</artwork></figure>
[540]1596<figure>
1597  <preamble>For example</preamble>
1598<artwork type="example">
[364]1599  Expires: Thu, 01 Dec 1994 16:00:00 GMT
[540]1600</artwork></figure>
[1400]1601<t>
[2082]1602   A cache recipient &MUST; interpret invalid date formats, especially the
1603   value "0", as representing a time in the past (i.e., "already expired").
[1400]1604</t>
[540]1605<t>
[2082]1606   If a response includes a <x:ref>Cache-Control</x:ref> field with
1607   the max-age directive (<xref target="cache-response-directive.max-age"/>),
1608   a recipient &MUST; ignore the Expires field.
1609   Likewise, if a response includes the s-maxage directive
1610   (<xref target="cache-response-directive.s-maxage" />), a shared cache
1611   recipient &MUST; ignore the Expires field. In both these cases, the value
1612   in Expires is only intended for recipients that have not yet implemented
1613   the Cache-Control field.
1614</t>
1615<t>
1616   An origin server without a clock &MUST-NOT; generate an Expires field
1617   unless its value represents a fixed time in the past (always expired)
1618   or its value has been associated with the resource by a system or user
1619   with a reliable clock.
1620</t>
1621<t>
[1400]1622   Historically, HTTP required the Expires field-value to be no more than a
1623   year in the future. While longer freshness lifetimes are no longer
1624   prohibited, extremely large values have been demonstrated to cause
1625   problems (e.g., clock overflows due to use of 32-bit integers for
[1752]1626   time values), and many caches will evict a response far sooner than
[2030]1627   that.
[540]1628</t>
1629</section>
[8]1630
[540]1631<section anchor="header.pragma" title="Pragma">
[1120]1632   <iref item="Pragma header field" primary="true" x:for-anchor="" />
[949]1633   <x:anchor-alias value="extension-pragma"/>
1634   <x:anchor-alias value="Pragma"/>
1635   <x:anchor-alias value="pragma-directive"/>
[575]1636<t>
[1287]1637   The "Pragma" header field allows backwards compatibility with HTTP/1.0
[1284]1638   caches, so that clients can specify a "no-cache" request that they will
[1737]1639   understand (as <x:ref>Cache-Control</x:ref> was not defined until HTTP/1.1).
1640   When the Cache-Control header field is also present and understood in a
1641   request, Pragma is ignored.
[540]1642</t>
[1284]1643<t>
[1287]1644   In HTTP/1.0, Pragma was defined as an extensible field for
[1284]1645   implementation-specified directives for recipients. This specification
1646   deprecates such extensions to improve interoperability.
1647</t>
[1231]1648<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Pragma"/><iref primary="true" item="Grammar" subitem="pragma-directive"/><iref primary="true" item="Grammar" subitem="extension-pragma"/>
1649  <x:ref>Pragma</x:ref>           = 1#<x:ref>pragma-directive</x:ref>
1650  <x:ref>pragma-directive</x:ref> = "no-cache" / <x:ref>extension-pragma</x:ref>
1651  <x:ref>extension-pragma</x:ref> = <x:ref>token</x:ref> [ "=" ( <x:ref>token</x:ref> / <x:ref>quoted-string</x:ref> ) ]
[8]1652</artwork></figure>
[540]1653<t>
[1737]1654   When the <x:ref>Cache-Control</x:ref> header field is not present in a
1655   request, the no-cache request pragma-directive &MUST; have the same effect
1656   on caches as if "Cache-Control: no-cache" were present (see <xref
[1284]1657   target="cache-request-directive" />).
[540]1658</t>
[1284]1659<t>
[1433]1660   When sending a no-cache request, a client ought to include both the pragma
1661   and cache-control directives, unless Cache-Control: no-cache is
[1737]1662   purposefully omitted to target other <x:ref>Cache-Control</x:ref> response
1663   directives at HTTP/1.1 caches. For example:
[1284]1664</t>
1665<figure>
[1287]1666<artwork type="message/http; msgtype=&#34;response&#34;" x:indent-with="  ">
[1284]1667GET / HTTP/1.1
1668Host: www.example.com
1669Cache-Control: max-age=30
1670Pragma: no-cache
[1287]1671
[1284]1672</artwork>
1673</figure>
1674<t>
1675   will constrain HTTP/1.1 caches to serve a response no older than 30
1676   seconds, while precluding implementations that do not understand
[1737]1677   <x:ref>Cache-Control</x:ref> from serving a cached response.
[1284]1678</t>
[540]1679<x:note>
[949]1680   <t>
[1692]1681      &Note; Because the meaning of "Pragma: no-cache" in responses is not
[1284]1682      specified, it does not provide a reliable replacement for
1683      "Cache-Control: no-cache" in them.
[1287]1684   </t>
[540]1685</x:note>
1686</section>
[8]1687
[540]1688<section anchor="header.warning" title="Warning">
[1120]1689   <iref item="Warning header field" primary="true" x:for-anchor="" />
[949]1690   <x:anchor-alias value="Warning"/>
1691   <x:anchor-alias value="warning-value"/>
1692   <x:anchor-alias value="warn-agent"/>
1693   <x:anchor-alias value="warn-code"/>
1694   <x:anchor-alias value="warn-date"/>
1695   <x:anchor-alias value="warn-text"/>
[540]1696<t>
[1163]1697   The "Warning" header field is used to carry additional information
[949]1698   about the status or transformation of a message that might not be reflected
1699   in the message. This information is typically used to warn about possible
1700   incorrectness introduced by caching operations or transformations applied
1701   to the payload of the message.
[540]1702</t>
1703<t>
[949]1704   Warnings can be used for other purposes, both cache-related and otherwise.
1705   The use of a warning, rather than an error status code, distinguishes these
1706   responses from true failures.
[540]1707</t>
1708<t>
[994]1709   Warning header fields can in general be applied to any message, however some
[949]1710   warn-codes are specific to caches and can only be applied to response
1711   messages.
[540]1712</t>
[1231]1713<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Warning"/><iref primary="true" item="Grammar" subitem="warning-value"/><iref primary="true" item="Grammar" subitem="warn-code"/><iref primary="true" item="Grammar" subitem="warn-agent"/><iref primary="true" item="Grammar" subitem="warn-text"/><iref primary="true" item="Grammar" subitem="warn-date"/>
1714  <x:ref>Warning</x:ref>       = 1#<x:ref>warning-value</x:ref>
[135]1715 
[229]1716  <x:ref>warning-value</x:ref> = <x:ref>warn-code</x:ref> <x:ref>SP</x:ref> <x:ref>warn-agent</x:ref> <x:ref>SP</x:ref> <x:ref>warn-text</x:ref>
1717                                        [<x:ref>SP</x:ref> <x:ref>warn-date</x:ref>]
[135]1718 
[229]1719  <x:ref>warn-code</x:ref>  = 3<x:ref>DIGIT</x:ref>
[334]1720  <x:ref>warn-agent</x:ref> = ( <x:ref>uri-host</x:ref> [ ":" <x:ref>port</x:ref> ] ) / <x:ref>pseudonym</x:ref>
[135]1721                  ; the name or pseudonym of the server adding
[994]1722                  ; the Warning header field, for use in debugging
[229]1723  <x:ref>warn-text</x:ref>  = <x:ref>quoted-string</x:ref>
1724  <x:ref>warn-date</x:ref>  = <x:ref>DQUOTE</x:ref> <x:ref>HTTP-date</x:ref> <x:ref>DQUOTE</x:ref>
[8]1725</artwork></figure>
[540]1726<t>
[949]1727   Multiple warnings can be attached to a response (either by the origin
1728   server or by a cache), including multiple warnings with the same code
1729   number, only differing in warn-text.
[540]1730</t>
1731<t>
[949]1732   When this occurs, the user agent &SHOULD; inform the user of as many of
1733   them as possible, in the order that they appear in the response.
[540]1734</t>
1735<t>
[1433]1736   Systems that generate multiple Warning header fields are encouraged to
1737   order them with this user agent behavior in mind. New Warning header fields
[1772]1738   are added after any existing Warning header fields.
[540]1739</t>
1740<t>
[949]1741   Warnings are assigned three digit warn-codes. The first digit indicates
1742   whether the Warning is required to be deleted from a stored response after
1743   validation:
1744   <list style="symbols">
1745      <t>1xx Warnings describe the freshness or validation status of the
[1112]1746      response, and so &MUST; be deleted by a cache after validation. They can
[949]1747      only be generated by a cache when validating a cached entry, and
1748      &MUST-NOT; be generated in any other situation.</t>
1749      <t>2xx Warnings describe some aspect of the representation that is not
1750      rectified by a validation (for example, a lossy compression of the
[1112]1751      representation) and &MUST-NOT; be deleted by a cache after validation,
[2052]1752      unless a full response is sent, in which case they &MUST; be.</t>
[949]1753   </list>
[540]1754</t>
1755<t>
[1746]1756   If an implementation sends a message with one or more Warning header fields
1757   to a receiver whose version is HTTP/1.0 or lower, then the sender &MUST;
1758   include in each warning-value a warn-date that matches the
1759   <x:ref>Date</x:ref> header field in the message.
[540]1760</t>
1761<t>
[1746]1762   If a system receives a message with a warning-value that includes a
1763   warn-date, and that warn-date is different from the <x:ref>Date</x:ref>
[1740]1764   value in the response, then that warning-value &MUST; be deleted from the
[1746]1765   message before storing, forwarding, or using it. (preventing the
1766   consequences of naive caching of Warning header fields.) If all of the
1767   warning-values are deleted for this reason, the Warning header field &MUST;
1768   be deleted as well.
[540]1769</t>
1770<t>
[949]1771   The following warn-codes are defined by this specification, each with a
1772   recommended warn-text in English, and a description of its meaning.
[540]1773</t>
[1487]1774
1775<section title="110 Response is Stale" anchor="warn.110">
1776  <iref primary="true" item="110 Response is Stale (warn code)" x:for-anchor=""/>
1777<t>
[2073]1778   A cache &SHOULD; generate this whenever the sent response is stale.
[540]1779</t>
[1487]1780</section>
1781
1782<section title="111 Revalidation Failed" anchor="warn.111">
1783  <iref primary="true" item="111 Revalidation Failed (warn code)" x:for-anchor=""/>
1784<t>
[2073]1785   A cache &SHOULD; generate this when sending a stale response because an
[1487]1786   attempt to validate the response failed, due to an inability to reach
1787   the server.
[540]1788</t>
[1487]1789</section>
1790
1791<section title="112 Disconnected Operation" anchor="warn.112">
1792  <iref primary="true" item="112 Disconnected Operation (warn code)" x:for-anchor=""/>
1793<t>
[2073]1794   A cache &SHOULD; generate this if it is intentionally disconnected from
[1487]1795   the rest of the network for a period of time.
[540]1796</t>
[1487]1797</section>
1798
1799<section title="113 Heuristic Expiration" anchor="warn.113">
1800  <iref primary="true" item="113 Heuristic Expiration (warn code)" x:for-anchor=""/>
1801<t>
[2073]1802   A cache &SHOULD; generate this if it heuristically chose a freshness
[1487]1803   lifetime greater than 24 hours and the response's age is greater than 24
1804   hours.
[540]1805</t>
[1487]1806</section>
1807
1808<section title="199 Miscellaneous Warning" anchor="warn.199">
1809  <iref primary="true" item="199 Miscellaneous Warning (warn code)" x:for-anchor=""/>
1810<t>
1811   The warning text can include arbitrary information to be presented to
1812   a human user, or logged. A system receiving this warning &MUST-NOT; take
1813   any automated action, besides presenting the warning to the user.
[540]1814</t>
[1487]1815</section>
1816
1817<section title="214 Transformation Applied" anchor="warn.214">
1818  <iref primary="true" item="214 Transformation Applied (warn code)" x:for-anchor=""/>
1819<t>
1820   &MUST; be added by a proxy if it applies any transformation to the
1821   representation, such as changing the content-coding, media-type, or
1822   modifying the representation data, unless this Warning code already appears
1823   in the response.
[540]1824</t>
[1487]1825</section>
1826
1827<section title="299 Miscellaneous Persistent Warning" anchor="warn.299">
1828  <iref primary="true" item="299 Miscellaneous Persistent Warning (warn code)" x:for-anchor=""/>
1829<t>
1830   The warning text can include arbitrary information to be presented to
1831   a human user, or logged. A system receiving this warning &MUST-NOT; take
1832   any automated action.
[540]1833</t>
[1487]1834</section>
1835
[1485]1836<section title="Warn Code Extensions" anchor="warn.code.extensions">
1837<t>
1838   The HTTP Warn Code Registry defines the name space for warn codes.
1839</t>
1840<t>
1841   A registration &MUST; include the following fields:
1842   <list style="symbols">
1843      <t>Warn Code (3 digits)</t>
1844      <t>Short Description</t>
1845      <t>Pointer to specification text</t>
1846   </list>
1847</t>
1848<t>
[1567]1849   Values to be added to this name space require IETF Review (see <xref
[1485]1850   target="RFC5226" x:fmt="," x:sec="4.1"/>).
1851</t>
1852<t>
1853   The registry itself is maintained at <eref
1854   target="http://www.iana.org/assignments/http-warn-codes"/>.
1855</t>
[540]1856</section>
1857</section>
[1513]1858</section>
[8]1859
[540]1860<section anchor="history.lists" title="History Lists">
1861<t>
[949]1862   User agents often have history mechanisms, such as "Back" buttons and
1863   history lists, that can be used to redisplay a representation retrieved
1864   earlier in a session.
[540]1865</t>
1866<t>
[949]1867   The freshness model (<xref target="expiration.model"/>) does not
1868   necessarily apply to history mechanisms. I.e., a history mechanism can
1869   display a previous representation even if it has expired.
[575]1870</t>
[949]1871<t>
1872   This does not prohibit the history mechanism from telling the user that a
1873   view might be stale, or from honoring cache directives (e.g.,
1874   Cache-Control: no-store).
1875</t>
[540]1876</section>
[8]1877
[253]1878
[540]1879<section anchor="IANA.considerations" title="IANA Considerations">
[8]1880
[949]1881<section title="Cache Directive Registry"
1882   anchor="cache.directive.registration">
[817]1883<t>
[949]1884   The registration procedure for HTTP Cache Directives is defined by <xref
1885   target="cache.control.extensions"/> of this document.
[817]1886</t>
1887<t>
[969]1888   The HTTP Cache Directive Registry shall be created at <eref
[949]1889   target="http://www.iana.org/assignments/http-cache-directives"/> and be
1890   populated with the registrations below:
[817]1891</t>
1892<?BEGININC p6-cache.cache-directives ?>
1893<!--AUTOGENERATED FROM extract-cache-directives-defs.xslt, do not edit manually-->
[825]1894<texttable xmlns:my="#my" align="left" suppress-title="true"
[817]1895           anchor="iana.cache.directive.registration.table">
1896   <ttcol>Cache Directive</ttcol>
1897   <ttcol>Reference</ttcol>
1898
1899   <c>max-age</c>
1900   <c>
[1695]1901      <xref target="cache-request-directive.max-age"/>, <xref target="cache-response-directive.max-age"/>
[817]1902   </c>
1903   <c>max-stale</c>
1904   <c>
[1695]1905      <xref target="cache-request-directive.max-stale"/>
[817]1906   </c>
1907   <c>min-fresh</c>
1908   <c>
[1695]1909      <xref target="cache-request-directive.min-fresh"/>
[817]1910   </c>
1911   <c>must-revalidate</c>
1912   <c>
[1695]1913      <xref target="cache-response-directive.must-revalidate"/>
[817]1914   </c>
1915   <c>no-cache</c>
1916   <c>
[1695]1917      <xref target="cache-request-directive.no-cache"/>, <xref target="cache-response-directive.no-cache"/>
[817]1918   </c>
1919   <c>no-store</c>
1920   <c>
[1695]1921      <xref target="cache-request-directive.no-store"/>, <xref target="cache-response-directive.no-store"/>
[817]1922   </c>
1923   <c>no-transform</c>
1924   <c>
[1695]1925      <xref target="cache-request-directive.no-transform"/>, <xref target="cache-response-directive.no-transform"/>
[817]1926   </c>
1927   <c>only-if-cached</c>
1928   <c>
[1695]1929      <xref target="cache-request-directive.only-if-cached"/>
[817]1930   </c>
1931   <c>private</c>
1932   <c>
[1695]1933      <xref target="cache-response-directive.private"/>
[817]1934   </c>
1935   <c>proxy-revalidate</c>
1936   <c>
[1695]1937      <xref target="cache-response-directive.proxy-revalidate"/>
[817]1938   </c>
1939   <c>public</c>
1940   <c>
[2020]1941      <xref target="cache-response-directive.public"/>
[817]1942   </c>
1943   <c>s-maxage</c>
1944   <c>
[1695]1945      <xref target="cache-response-directive.s-maxage"/>
[817]1946   </c>
[825]1947   <c>stale-if-error</c>
1948   <c>
1949      <xref xmlns:x="http://purl.org/net/xml2rfc/ext" target="RFC5861" x:fmt="," x:sec="4"/>
1950   </c>
1951   <c>stale-while-revalidate</c>
1952   <c>
1953      <xref xmlns:x="http://purl.org/net/xml2rfc/ext" target="RFC5861" x:fmt="," x:sec="3"/>
1954   </c>
[817]1955</texttable>
1956<!--(END)-->
1957<?ENDINC p6-cache.cache-directives ?>
1958</section>
1959
[1485]1960<section title="Warn Code Registry"
1961   anchor="warn.code.registration">
1962<t>
1963   The registration procedure for HTTP Warn Codes is defined by <xref
1964   target="warn.code.extensions"/> of this document.
1965</t>
1966<t>
1967   The HTTP Warn Code Registry shall be created at <eref
1968   target="http://www.iana.org/assignments/http-cache-directives"/> and be
1969   populated with the registrations below:
1970</t>
[1487]1971<?BEGININC p6-cache.iana-warn-codes ?>
1972<!--AUTOGENERATED FROM extract-warn-code-defs.xslt, do not edit manually-->
1973<texttable align="left" suppress-title="true" anchor="iana.warn.code.registration.table">
[1485]1974   <ttcol>Warn Code</ttcol>
1975   <ttcol>Short Description</ttcol>
1976   <ttcol>Reference</ttcol>
1977   <c>110</c>
[1487]1978   <c>Response is Stale</c>
1979   <c>
1980      <xref target="warn.110"/>
1981   </c>
[1485]1982   <c>111</c>
[1487]1983   <c>Revalidation Failed</c>
1984   <c>
1985      <xref target="warn.111"/>
1986   </c>
[1485]1987   <c>112</c>
[1487]1988   <c>Disconnected Operation</c>
1989   <c>
1990      <xref target="warn.112"/>
1991   </c>
[1485]1992   <c>113</c>
[1487]1993   <c>Heuristic Expiration</c>
1994   <c>
1995      <xref target="warn.113"/>
1996   </c>
[1485]1997   <c>199</c>
[1487]1998   <c>Miscellaneous Warning</c>
1999   <c>
2000      <xref target="warn.199"/>
2001   </c>
[1485]2002   <c>214</c>
[1487]2003   <c>Transformation Applied</c>
2004   <c>
2005      <xref target="warn.214"/>
2006   </c>
[1485]2007   <c>299</c>
[1487]2008   <c>Miscellaneous Persistent Warning</c>
2009   <c>
2010      <xref target="warn.299"/>
2011   </c>
[1485]2012</texttable>
[1487]2013<!--(END)-->
2014<?ENDINC p6-cache.iana-warn-codes ?>
[1485]2015</section>
2016
[921]2017<section title="Header Field Registration" anchor="header.field.registration">
[540]2018<t>
[949]2019  The Message Header Field Registry located at <eref 
[540]2020  target="http://www.iana.org/assignments/message-headers/message-header-index.html" />
[2046]2021  shall be updated with the permanent registrations below (see <xref target="BCP90" />):
[540]2022</t>
[680]2023<?BEGININC p6-cache.iana-headers ?>
[540]2024<!--AUTOGENERATED FROM extract-header-defs.xslt, do not edit manually-->
[680]2025<texttable align="left" suppress-title="true" anchor="iana.header.registration.table">
2026   <ttcol>Header Field Name</ttcol>
2027   <ttcol>Protocol</ttcol>
2028   <ttcol>Status</ttcol>
2029   <ttcol>Reference</ttcol>
[31]2030
[680]2031   <c>Age</c>
2032   <c>http</c>
2033   <c>standard</c>
2034   <c>
2035      <xref target="header.age"/>
2036   </c>
2037   <c>Cache-Control</c>
2038   <c>http</c>
2039   <c>standard</c>
2040   <c>
2041      <xref target="header.cache-control"/>
2042   </c>
2043   <c>Expires</c>
2044   <c>http</c>
2045   <c>standard</c>
2046   <c>
2047      <xref target="header.expires"/>
2048   </c>
2049   <c>Pragma</c>
2050   <c>http</c>
2051   <c>standard</c>
2052   <c>
2053      <xref target="header.pragma"/>
2054   </c>
2055   <c>Warning</c>
2056   <c>http</c>
2057   <c>standard</c>
2058   <c>
2059      <xref target="header.warning"/>
2060   </c>
[540]2061</texttable>
2062<!--(END)-->
[680]2063<?ENDINC p6-cache.iana-headers ?>
[540]2064<t>
[949]2065   The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task
2066   Force".
[540]2067</t>
2068</section>
2069</section>
[31]2070
[540]2071<section anchor="security.considerations" title="Security Considerations">
2072<t>
[2069]2073   This section is meant to inform developers, information providers, and
2074   users of known security concerns specific to HTTP/1.1 caching.
2075   More general security considerations are addressed in HTTP messaging
2076   &messaging; and semantics &semantics;.
2077</t>
2078<t>
[949]2079   Caches expose additional potential vulnerabilities, since the contents of
2080   the cache represent an attractive target for malicious exploitation.
2081   Because cache contents persist after an HTTP request is complete, an attack
2082   on the cache can reveal information long after a user believes that the
2083   information has been removed from the network. Therefore, cache contents
[969]2084   need to be protected as sensitive information.
[540]2085</t>
[1865]2086<t>
[1959]2087   Furthermore, the very use of a cache can bring about privacy concerns. For
2088   example, if two users share a cache, and the first one browses to a site,
2089   the second may be able to detect that the other has been to that site,
2090   because the resources from it load more quickly, thanks to the cache.
2091</t>
2092<t>
[1865]2093   Implementation flaws might allow attackers to insert content into a cache
2094   ("cache poisoning"), leading to compromise of clients that trust that
2095   content. Because of their nature, these attacks are difficult to mitigate.
2096</t>
2097<t>
2098   Likewise, implementation flaws (as well as misunderstanding of cache
2099   operation) might lead to caching of sensitive information (e.g.,
2100   authentication credentials) that is thought to be private, exposing it to
[1945]2101   unauthorized parties.
[1865]2102</t>
2103<t>
2104   Note that the Set-Cookie response header <xref target="RFC6265"/> does not
2105   inhibit caching; a cacheable response with a Set-Cookie header can be (and
2106   often is) used to satisfy subsequent requests to caches. Servers who wish
2107   to control caching of these responses are encouraged to emit appropriate
2108   Cache-Control response headers.
2109</t>
2110
[540]2111</section>
[31]2112
[1364]2113<section title="Acknowledgments" anchor="acks">
[540]2114<t>
[1364]2115  See &acks;.
[540]2116</t>
2117</section>
[131]2118
[540]2119</middle>
[96]2120
[540]2121<back>
2122<references title="Normative References">
[425]2123
[540]2124  <reference anchor="Part1">
2125    <front>
[1864]2126      <title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
[540]2127      <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
[1106]2128        <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[540]2129        <address><email>fielding@gbiv.com</email></address>
2130      </author>
2131      <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
2132        <organization abbrev="greenbytes">greenbytes GmbH</organization>
2133        <address><email>julian.reschke@greenbytes.de</email></address>
2134      </author>
2135      <date month="&ID-MONTH;" year="&ID-YEAR;" />
2136    </front>
2137    <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p1-messaging-&ID-VERSION;" />
[1741]2138    <x:source basename="p1-messaging" href="p1-messaging.xml">
2139      <x:defines>Content-Length</x:defines>
2140      <x:defines>Via</x:defines>
2141    </x:source>
[540]2142  </reference>
[119]2143
[540]2144  <reference anchor="Part2">
2145    <front>
[1864]2146      <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
[540]2147      <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
[1106]2148        <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[540]2149        <address><email>fielding@gbiv.com</email></address>
2150      </author>
2151      <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
2152        <organization abbrev="greenbytes">greenbytes GmbH</organization>
2153        <address><email>julian.reschke@greenbytes.de</email></address>
2154      </author>
2155      <date month="&ID-MONTH;" year="&ID-YEAR;" />
2156    </front>
2157    <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p2-semantics-&ID-VERSION;" />
[1710]2158    <x:source basename="p2-semantics" href="p2-semantics.xml">
[1735]2159      <x:defines>2xx (Successful)</x:defines>
[1715]2160      <x:defines>200 (OK)</x:defines>
[1735]2161      <x:defines>203 (Non-Authoritative Information)</x:defines>
2162      <x:defines>3xx (Redirection)</x:defines>
2163      <x:defines>300 (Multiple Choices)</x:defines>
2164      <x:defines>301 (Moved Permanently)</x:defines>
[1713]2165      <x:defines>404 (Not Found)</x:defines>
[1735]2166      <x:defines>410 (Gone)</x:defines>
2167      <x:defines>5xx (Server Error)</x:defines>
[1710]2168      <x:defines>504 (Gateway Timeout)</x:defines>
[1740]2169      <x:defines>Content-Encoding</x:defines>
2170      <x:defines>Content-Location</x:defines>
2171      <x:defines>Content-Type</x:defines>
2172      <x:defines>Date</x:defines>
2173      <x:defines>Location</x:defines>
[1860]2174      <x:defines>Vary</x:defines>
[1710]2175    </x:source>
[540]2176  </reference>
[129]2177
[540]2178  <reference anchor="Part4">
2179    <front>
[1864]2180      <title>Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests</title>
[540]2181      <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
[1106]2182        <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[540]2183        <address><email>fielding@gbiv.com</email></address>
2184      </author>
2185      <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
2186        <organization abbrev="greenbytes">greenbytes GmbH</organization>
2187        <address><email>julian.reschke@greenbytes.de</email></address>
2188      </author>
2189      <date month="&ID-MONTH;" year="&ID-YEAR;" />
2190    </front>
2191    <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p4-conditional-&ID-VERSION;" />
[1708]2192    <x:source basename="p4-conditional" href="p4-conditional.xml">
[1734]2193      <x:defines>304</x:defines>
[1708]2194      <x:defines>304 (Not Modified)</x:defines>
[1739]2195      <x:defines>ETag</x:defines>
2196      <x:defines>If-Modified-Since</x:defines>
2197      <x:defines>If-None-Match</x:defines>
2198      <x:defines>Last-Modified</x:defines>
[1708]2199    </x:source>
[540]2200  </reference>
[253]2201
[540]2202  <reference anchor="Part5">
2203    <front>
[1864]2204      <title>Hypertext Transfer Protocol (HTTP/1.1): Range Requests</title>
[540]2205      <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
[1106]2206        <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[540]2207        <address><email>fielding@gbiv.com</email></address>
2208      </author>
2209      <author fullname="Yves Lafon" initials="Y." role="editor" surname="Lafon">
2210        <organization abbrev="W3C">World Wide Web Consortium</organization>
2211        <address><email>ylafon@w3.org</email></address>
2212      </author>
2213      <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
2214        <organization abbrev="greenbytes">greenbytes GmbH</organization>
2215        <address><email>julian.reschke@greenbytes.de</email></address>
2216      </author>
2217      <date month="&ID-MONTH;" year="&ID-YEAR;" />
2218    </front>
2219    <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p5-range-&ID-VERSION;" />
[1708]2220    <x:source basename="p5-range" href="p5-range.xml">
2221      <x:defines>206 (Partial Content)</x:defines>
[1738]2222      <x:defines>Content-Range</x:defines>
2223      <x:defines>Range</x:defines>
[1708]2224    </x:source>
[540]2225  </reference>
[119]2226
[540]2227  <reference anchor="Part7">
2228    <front>
[1864]2229      <title>Hypertext Transfer Protocol (HTTP/1.1): Authentication</title>
[540]2230      <author fullname="Roy T. Fielding" initials="R." role="editor" surname="Fielding">
[1106]2231        <organization abbrev="Adobe">Adobe Systems Incorporated</organization>
[540]2232        <address><email>fielding@gbiv.com</email></address>
2233      </author>
2234      <author fullname="Julian F. Reschke" initials="J. F." role="editor" surname="Reschke">
2235        <organization abbrev="greenbytes">greenbytes GmbH</organization>
2236        <address><email>julian.reschke@greenbytes.de</email></address>
2237      </author>
2238      <date month="&ID-MONTH;" year="&ID-YEAR;" />
2239    </front>
2240    <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-p7-auth-&ID-VERSION;" />
[1736]2241    <x:source basename="p7-auth" href="p7-auth.xml">
2242      <x:defines>Authorization</x:defines>
2243    </x:source>
[540]2244  </reference>
[99]2245
[540]2246  <reference anchor="RFC2119">
2247    <front>
2248      <title>Key words for use in RFCs to Indicate Requirement Levels</title>
2249      <author fullname="Scott Bradner" initials="S." surname="Bradner">
2250        <organization>Harvard University</organization>
2251        <address><email>sob@harvard.edu</email></address>
2252      </author>
2253      <date month="March" year="1997" />
2254    </front>
2255    <seriesInfo name="BCP" value="14" />
2256    <seriesInfo name="RFC" value="2119" />
2257  </reference>
[99]2258
[540]2259  <reference anchor="RFC5234">
2260    <front>
2261      <title abbrev="ABNF for Syntax Specifications">Augmented BNF for Syntax Specifications: ABNF</title>
2262      <author initials="D." surname="Crocker" fullname="Dave Crocker" role="editor">
2263        <organization>Brandenburg InternetWorking</organization>
2264        <address>
[728]2265          <email>dcrocker@bbiw.net</email>
2266        </address> 
[540]2267      </author>
2268      <author initials="P." surname="Overell" fullname="Paul Overell">
2269        <organization>THUS plc.</organization>
2270        <address>
[728]2271          <email>paul.overell@thus.net</email>
2272        </address>
[540]2273      </author>
2274      <date month="January" year="2008"/>
2275    </front>
2276    <seriesInfo name="STD" value="68"/>
2277    <seriesInfo name="RFC" value="5234"/>
2278  </reference>
2279 
2280</references>
[99]2281
[540]2282<references title="Informative References">
[538]2283
[540]2284  <reference anchor="RFC1305">
2285    <front>
2286      <title>Network Time Protocol (Version 3) Specification, Implementation</title>
2287      <author fullname="David L. Mills" initials="D." surname="Mills">
2288        <organization>University of Delaware, Electrical Engineering Department</organization>
2289        <address><email>mills@udel.edu</email></address>
2290      </author>
2291      <date month="March" year="1992" />
2292    </front>
2293    <seriesInfo name="RFC" value="1305" />
2294  </reference>
[538]2295
[540]2296  <reference anchor="RFC2616">
2297    <front>
2298      <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
2299      <author fullname="R. Fielding" initials="R." surname="Fielding">
2300        <organization>University of California, Irvine</organization>
2301        <address><email>fielding@ics.uci.edu</email></address>
2302      </author>
2303      <author fullname="J. Gettys" initials="J." surname="Gettys">
2304        <organization>W3C</organization>
2305        <address><email>jg@w3.org</email></address>
2306      </author>
2307      <author fullname="J. Mogul" initials="J." surname="Mogul">
2308        <organization>Compaq Computer Corporation</organization>
2309        <address><email>mogul@wrl.dec.com</email></address>
2310      </author>
2311      <author fullname="H. Frystyk" initials="H." surname="Frystyk">
2312        <organization>MIT Laboratory for Computer Science</organization>
2313        <address><email>frystyk@w3.org</email></address>
2314      </author>
2315      <author fullname="L. Masinter" initials="L." surname="Masinter">
2316        <organization>Xerox Corporation</organization>
2317        <address><email>masinter@parc.xerox.com</email></address>
2318      </author>
2319      <author fullname="P. Leach" initials="P." surname="Leach">
2320        <organization>Microsoft Corporation</organization>
2321        <address><email>paulle@microsoft.com</email></address>
2322      </author>
2323      <author fullname="T. Berners-Lee" initials="T." surname="Berners-Lee">
2324        <organization>W3C</organization>
2325        <address><email>timbl@w3.org</email></address>
2326      </author>
2327      <date month="June" year="1999" />
2328    </front>
2329    <seriesInfo name="RFC" value="2616" />
2330  </reference>
2331
[2046]2332  <reference anchor="BCP90">
[540]2333    <front>
2334      <title>Registration Procedures for Message Header Fields</title>
2335      <author fullname="G. Klyne" initials="G." surname="Klyne">
2336        <organization>Nine by Nine</organization>
2337        <address><email>GK-IETF@ninebynine.org</email></address>
2338      </author>
2339      <author fullname="M. Nottingham" initials="M." surname="Nottingham">
2340        <organization>BEA Systems</organization>
2341        <address><email>mnot@pobox.com</email></address>
2342      </author>
2343      <author fullname="J. Mogul" initials="J." surname="Mogul">
2344        <organization>HP Labs</organization>
2345        <address><email>JeffMogul@acm.org</email></address>
2346      </author>
2347      <date month="September" year="2004" />
2348    </front>
2349    <seriesInfo name="BCP" value="90" />
2350    <seriesInfo name="RFC" value="3864" />
2351  </reference>
2352
[817]2353  <reference anchor='RFC5226'>
2354    <front>
2355      <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
2356      <author initials='T.' surname='Narten' fullname='T. Narten'>
2357        <organization>IBM</organization>
2358        <address><email>narten@us.ibm.com</email></address>
2359      </author>
2360      <author initials='H.' surname='Alvestrand' fullname='H. Alvestrand'>
2361        <organization>Google</organization>
2362        <address><email>Harald@Alvestrand.no</email></address>
2363      </author>
2364      <date year='2008' month='May' />
2365    </front>
2366    <seriesInfo name='BCP' value='26' />
2367    <seriesInfo name='RFC' value='5226' />
2368  </reference>
2369
[825]2370  <reference anchor='RFC5861'>
2371    <front>
2372      <title abbrev="HTTP stale controls">HTTP Cache-Control Extensions for Stale Content</title>
2373      <author initials="M." surname="Nottingham" fullname="Mark Nottingham">
2374        <organization>Yahoo! Inc.</organization>
2375        <address><email>mnot@yahoo-inc.com</email></address>
2376      </author>
2377      <date month="April" year="2010"/>
2378    </front>
2379    <seriesInfo name='RFC' value='5861' />
2380  </reference>
2381
[1865]2382  <reference anchor="RFC6265">
2383    <front>
2384      <title>HTTP State Management Mechanism</title>
[1867]2385      <author initials="A." surname="Barth" fullname="Adam Barth">
2386        <organization abbrev="U.C. Berkeley">
2387          University of California, Berkeley
2388        </organization>
2389        <address><email>abarth@eecs.berkeley.edu</email></address>
[1865]2390      </author>
[1867]2391      <date year="2011" month="April" />
[1865]2392    </front>
2393    <seriesInfo name="RFC" value="6265"/>
2394  </reference>
2395
[540]2396</references>
2397
2398<section anchor="changes.from.rfc.2616" title="Changes from RFC 2616">
2399<t>
[2020]2400  Caching-related text has been substantially rewritten for clarity.
2401</t>
2402<t>
[2016]2403  The algorithm for calculating age is now less conservative.
[795]2404  (<xref target="age.calculations"/>)
2405</t>
2406<t>
[2020]2407  Caches are now required to handle dates with timezones as if they're
2408  invalid, because it's not possible to accurately guess.
2409  (<xref target="age.calculations"/>)
2410</t>
2411<t>
[2016]2412  The <x:ref>Content-Location</x:ref> response header field is no longer used
[2020]2413  to determine the appropriate response to use when validating.
[691]2414  (<xref target="validation.model" />)
2415</t>
2416<t>
[2020]2417  The algorithm for selecting a cached negotiated response to use has been
2418  clarified in several ways. In particular, it now explicitly allows
2419  header-specific canonicalization when processing selecting header fields.
2420  (<xref target="caching.negotiated.responses" />)
2421</t>
2422<t>
2423  Requirements regarding denial of service attack avoidance when performing
2424  invalidation have been clarified.
[540]2425  (<xref target="invalidation.after.updates.or.deletions" />)
2426</t>
[669]2427<t>
[2020]2428  Cache invalidation only occurs when a successful response is received.
2429  (<xref target="invalidation.after.updates.or.deletions" />)
2430</t>
2431<t>
2432  The conditions under which an authenticated response can be cached have been
2433  clarified.
2434  (<xref target="caching.authenticated.responses" />)
2435</t>
2436<t>
2437  The one-year limit on Expires header field values has been removed; instead,
2438  the reasoning for using a sensible value is given.
2439  (<xref target="header.expires" />)
2440</t>
2441<t>
2442  The Pragma header field is now only defined for backwards compatibility;
2443  future pragmas are deprecated.
2444  (<xref target="header.pragma" />)
2445</t>
2446<t>
2447  Cache directives are explicitly defined to be case-insensitive.
2448  (<xref target="header.cache-control" />)
2449</t>
2450<t>
2451  Handling of multiple instances of cache directives when only one is
2452  expected is now defined.
2453  (<xref target="header.cache-control" />)
2454</t>
2455<t>
2456  The qualified forms of the private and no-cache cache directives are noted
2457  to not be widely implemented; e.g., "private=foo" is interpreted by many
2458  caches as simply "private". Additionally, the meaning of the qualified
2459  form of no-cache has been clarified.
2460  (<xref target="cache-response-directive" />)
2461</t>
2462<t>
2463  The "no-store" cache request directive doesn't apply to responses; i.e.,
2464  a cache can satisfy a request with no-store on it, and does not invalidate
2465  it.
2466  (<xref target="cache-request-directive.no-store" />)
2467</t>
2468<t>
2469  The meaning of the "public" cache response directive has been refined to
2470  be less vague.
2471  (<xref target="cache-response-directive.public" />)
2472</t>
2473<t>
2474  The "no-cache" response cache directive's meaning has been clarified.
2475  (<xref target="cache-response-directive.no-cache" />)
2476</t>
2477<t>
2478  New status codes can now define that caches are allowed to use heuristic
2479  freshness with them.
2480  (<xref target="heuristic.freshness" />)
2481</t>
2482<t>
2483  Caches are now allow to calculate heuristic freshness for URLs with query
2484  components.
2485  (<xref target="heuristic.freshness" />)
2486</t>
2487<t>
2488  Some requirements regarding production of the <x:ref>Warning</x:ref>
2489  header have been relaxed, as it is not widely implemented.
2490  (<xref target="header.warning" />)
2491</t>
2492<t>
[2016]2493  The <x:ref>Warning</x:ref> header field no longer uses RFC 2047 encoding,
2494  nor allows multiple languages, as these aspects were not implemented.
[669]2495  (<xref target="header.warning" />)
2496</t>
[1760]2497<t>
[2020]2498  This specification introduces the Cache Directive and Warn Code Registries,
2499  and defines considerations for new cache directives.
[1760]2500  (<xref target="cache.control.extensions"/> and <xref target="warn.code.extensions"/>)
2501</t>
[540]2502</section>
2503
[1805]2504<section title="Imported ABNF" anchor="imported.abnf">
2505   <x:anchor-alias value="ALPHA"/>
2506   <x:anchor-alias value="CR"/>
2507   <x:anchor-alias value="DIGIT"/>
2508   <x:anchor-alias value="DQUOTE"/>
2509   <x:anchor-alias value="LF"/>
2510   <x:anchor-alias value="OCTET"/>
2511   <x:anchor-alias value="SP"/>
2512   <x:anchor-alias value="VCHAR"/>
2513   <x:anchor-alias value="quoted-string"/>
2514   <x:anchor-alias value="token"/>
2515   <x:anchor-alias value="OWS"/>
2516   <x:anchor-alias value="field-name"/>
2517   <x:anchor-alias value="HTTP-date"/>
2518   <x:anchor-alias value="port"/>
2519   <x:anchor-alias value="pseudonym"/>
2520   <x:anchor-alias value="uri-host"/>
2521<t>
2522   The following core rules are included by reference, as defined in <xref
[1806]2523   target="RFC5234" x:fmt="of" x:sec="B.1"/>: ALPHA (letters), CR (carriage
[1805]2524   return), CRLF (CR LF), CTL (controls), DIGIT (decimal 0-9), DQUOTE (double
2525   quote), HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed), OCTET (any 8-bit
2526   sequence of data), SP (space), and VCHAR (any visible US-ASCII character).
2527</t>
2528<t>
2529   The rules below are defined in <xref target="Part1"/>:
2530</t>
2531<figure><artwork type="abnf2616">
2532  <x:ref>OWS</x:ref>           = &lt;OWS, defined in &whitespace;&gt;
2533  <x:ref>field-name</x:ref>    = &lt;field-name, defined in &header-fields;&gt;
2534  <x:ref>quoted-string</x:ref> = &lt;quoted-string, defined in &field-components;&gt;
2535  <x:ref>token</x:ref>         = &lt;token, defined in &field-components;&gt;
2536
2537  <x:ref>port</x:ref>          = &lt;port, defined in &uri;&gt;
2538  <x:ref>pseudonym</x:ref>     = &lt;pseudonym, defined in &header-via;&gt;
2539  <x:ref>uri-host</x:ref>      = &lt;uri-host, defined in &uri;&gt;
2540</artwork></figure>
2541<t>
2542   The rules below are defined in other parts:
2543</t>
2544<figure><artwork type="abnf2616">
2545  <x:ref>HTTP-date</x:ref>     = &lt;HTTP-date, defined in &http-date;&gt;
2546</artwork></figure>
2547</section>
2548
[680]2549<?BEGININC p6-cache.abnf-appendix ?>
[427]2550<section xmlns:x="http://purl.org/net/xml2rfc/ext" title="Collected ABNF" anchor="collected.abnf">
2551<figure>
2552<artwork type="abnf" name="p6-cache.parsed-abnf">
[1231]2553<x:ref>Age</x:ref> = delta-seconds
[427]2554
[1231]2555<x:ref>Cache-Control</x:ref> = *( "," OWS ) cache-directive *( OWS "," [ OWS
[425]2556 cache-directive ] )
[428]2557
[1231]2558<x:ref>Expires</x:ref> = HTTP-date
[427]2559
[2052]2560<x:ref>HTTP-date</x:ref> = &lt;HTTP-date, defined in [Part2], Section 7.1.1.1&gt;
[427]2561
[2044]2562<x:ref>OWS</x:ref> = &lt;OWS, defined in [Part1], Section 3.2.3&gt;
[427]2563
[1231]2564<x:ref>Pragma</x:ref> = *( "," OWS ) pragma-directive *( OWS "," [ OWS
[425]2565 pragma-directive ] )
[428]2566
[1231]2567<x:ref>Warning</x:ref> = *( "," OWS ) warning-value *( OWS "," [ OWS warning-value ]
2568 )
[428]2569
[1695]2570<x:ref>cache-directive</x:ref> = token [ "=" ( token / quoted-string ) ]
[428]2571
[427]2572<x:ref>delta-seconds</x:ref> = 1*DIGIT
2573
2574<x:ref>extension-pragma</x:ref> = token [ "=" ( token / quoted-string ) ]
2575
[678]2576<x:ref>field-name</x:ref> = &lt;field-name, defined in [Part1], Section 3.2&gt;
[427]2577
[1845]2578<x:ref>port</x:ref> = &lt;port, defined in [Part1], Section 2.7&gt;
[427]2579<x:ref>pragma-directive</x:ref> = "no-cache" / extension-pragma
[2044]2580<x:ref>pseudonym</x:ref> = &lt;pseudonym, defined in [Part1], Section 5.7.1&gt;
[427]2581
[2044]2582<x:ref>quoted-string</x:ref> = &lt;quoted-string, defined in [Part1], Section 3.2.6&gt;
[427]2583
[2044]2584<x:ref>token</x:ref> = &lt;token, defined in [Part1], Section 3.2.6&gt;
[427]2585
[1845]2586<x:ref>uri-host</x:ref> = &lt;uri-host, defined in [Part1], Section 2.7&gt;
[427]2587
2588<x:ref>warn-agent</x:ref> = ( uri-host [ ":" port ] ) / pseudonym
2589<x:ref>warn-code</x:ref> = 3DIGIT
2590<x:ref>warn-date</x:ref> = DQUOTE HTTP-date DQUOTE
2591<x:ref>warn-text</x:ref> = quoted-string
2592<x:ref>warning-value</x:ref> = warn-code SP warn-agent SP warn-text [ SP warn-date
[425]2593 ]
[454]2594</artwork>
2595</figure>
[1893]2596</section>
[680]2597<?ENDINC p6-cache.abnf-appendix ?>
[427]2598
[540]2599<section anchor="change.log" title="Change Log (to be removed by RFC Editor before publication)">
2600<t>
[1624]2601  Changes up to the first Working Group Last Call draft are summarized
2602  in <eref target="http://trac.tools.ietf.org/html/draft-ietf-httpbis-p6-cache-19#appendix-C"/>.
[540]2603</t>
[115]2604
[1592]2605<section title="Since draft-ietf-httpbis-p6-cache-19" anchor="changes.since.19">
2606<t>
[1666]2607  Closed issues:
2608  <list style="symbols">
2609    <t>
[1695]2610      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/307"/>:
2611      "untangle Cache-Control ABNF"
2612    </t>
2613    <t>
[1731]2614      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/353"/>:
[1772]2615      "Multiple values in Cache-Control header fields"
[1731]2616    </t>
2617    <t>
[1666]2618      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/355"/>:
2619      "Case sensitivity of header fields in CC values"
2620    </t>
2621    <t>
2622      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/356"/>:
[1776]2623      "Spurious 'MAYs'"
[1666]2624    </t>
[1682]2625    <t>
[1702]2626      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/360"/>:
2627      "enhance considerations for new cache control directives"
2628    </t>
2629    <t>
[1682]2630      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/361"/>:
2631      "ABNF requirements for recipients"
2632    </t>
[1760]2633    <t>
2634      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/368"/>:
2635      "note introduction of new IANA registries as normative changes"
2636    </t>
[1819]2637    <t>
2638      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/373"/>:
2639      "broken prose in description of 'Vary'"
2640    </t>
[1666]2641  </list>
[1592]2642</t>
[1499]2643</section>
[1592]2644
[1807]2645<section title="Since draft-ietf-httpbis-p6-cache-20" anchor="changes.since.20">
2646<t>
[1814]2647  Closed issues:
2648  <list style="symbols">
2649    <t>
2650      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/375"/>:
2651      "'Most Conservative'"
2652    </t>
[1889]2653  </list>
2654</t>
2655<t>
2656  Other changes:
2657  <list style="symbols">
[1885]2658    <t>
[1889]2659      Conformance criteria and considerations regarding error handling are
2660      now defined in Part 1.
2661    </t>
2662    <t>
[1885]2663      Move definition of "Vary" header field into Part 2.
2664    </t>
[1887]2665    <t>
2666      Add security considerations with respect to cache poisoning and
2667      the "Set-Cookie" header field.
2668    </t>
[1814]2669  </list>
[1807]2670</t>
[1592]2671</section>
[1807]2672
[1929]2673<section title="Since draft-ietf-httpbis-p6-cache-21" anchor="changes.since.21">
2674<t>
[2045]2675  Closed issues:
2676  <list style="symbols">
2677    <t>
2678      <eref target="http://tools.ietf.org/wg/httpbis/trac/ticket/418"/>:
2679      "No-Transform"
2680    </t>
2681  </list>
[1929]2682</t>
[1807]2683</section>
[1929]2684
2685</section>
[538]2686  </back>
[8]2687</rfc>
Note: See TracBrowser for help on using the repository browser.