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

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

prune change logs

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