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

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

Fix the maximum value for delta-seconds for senders to be 2147483647 instead of 2147483648, since the goal was to prevent 32bit INT_MAX overflow on recipients; reduce other implementation requirements to an ought and to what is necessary to preserve the intended value; see #512

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