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

Last change on this file since 2099 was 2088, checked in by fielding@…, 7 years ago

(editorial) Clarify that GET means retrieval; addresses #315

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