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

Last change on this file since 2632 was 2632, checked in by julian.reschke@…, 6 years ago

prune change logs, add AUTH48 statement to "Editorial Note" (#553)

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