source: draft-ietf-httpbis/21/draft-ietf-httpbis-p6-cache-21.xml @ 2650

Last change on this file since 2650 was 1929, checked in by julian.reschke@…, 8 years ago

prepare release of -21 drafts on Oct 4

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