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

Last change on this file since 2521 was 2512, checked in by mnot@…, 7 years ago

clear up "cache directive" language

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