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

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

Move imported ABNF rules to appendix sections

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