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

Last change on this file since 2177 was 2177, checked in by julian.reschke@…, 7 years ago

bump up document dates, update to latest version of rfc2629.xslt

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