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

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

improve introduction of list operator (see #542)

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