source: draft-ietf-httpbis/25/p6-cache.xml @ 2719

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

prepare publication of -25 drafts on 2013-11-17

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