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

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

(editorial) OWASP only provides useful additional info for web application semantics and authentication; see #520 and #549

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