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

Last change on this file since 2491 was 2491, checked in by fielding@…, 7 years ago

revert [2488]; see #512

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