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

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

Make ABNF/conformance terminology consistent (see #362)

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