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

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

Insert cross-document references.

  • Property svn:eol-style set to native
File size: 120.6 KB
Line 
1<?xml version="1.0" encoding="utf-8"?>
2<!DOCTYPE rfc [
3  <!ENTITY MAY "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MAY</bcp14>">
4  <!ENTITY MUST "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST</bcp14>">
5  <!ENTITY MUST-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>MUST NOT</bcp14>">
6  <!ENTITY OPTIONAL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>OPTIONAL</bcp14>">
7  <!ENTITY RECOMMENDED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>RECOMMENDED</bcp14>">
8  <!ENTITY REQUIRED "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>REQUIRED</bcp14>">
9  <!ENTITY SHALL "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL</bcp14>">
10  <!ENTITY SHALL-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHALL NOT</bcp14>">
11  <!ENTITY SHOULD "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD</bcp14>">
12  <!ENTITY SHOULD-NOT "<bcp14 xmlns='http://purl.org/net/xml2rfc/ext'>SHOULD NOT</bcp14>">
13  <!ENTITY ID-VERSION "latest">
14  <!ENTITY ID-MONTH "December">
15  <!ENTITY ID-YEAR "2007">
16  <!ENTITY messaging                   "<xref target='Part1' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
17  <!ENTITY combining-byte-ranges       "<xref target='Part5' x:rel='#combining.byte.ranges' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
18  <!ENTITY entity-length               "<xref target='Part3' x:rel='#entity.length' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
19  <!ENTITY entity-tags                 "<xref target='Part4' x:rel='#entity.tags' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
20  <!ENTITY full-date                   "<xref target='Part1' x:rel='#full.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
21  <!ENTITY header-authorization        "<xref target='Part7' x:rel='#header.authorization' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
22  <!ENTITY header-connection           "<xref target='Part1' x:rel='#header.connection' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
23  <!ENTITY header-date                 "<xref target='Part1' x:rel='#header.date' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
24  <!ENTITY weak-and-strong-validators  "<xref target='Part4' x:rel='#weak.and.strong.validators' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
25  <!ENTITY message-headers             "<xref target='Part1' x:rel='#message.headers' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
26  <!ENTITY message-length              "<xref target='Part1' x:rel='#message.length' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
27  <!ENTITY safe-methods                "<xref target='Part2' x:rel='#safe.methods' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
28  <!ENTITY server-driven-negotiation   "<xref target='Part3' x:rel='#server-driven.negotiation' xmlns:x='http://purl.org/net/xml2rfc/ext'/>">
29]>
30<?rfc toc="yes" ?>
31<?rfc symrefs="yes" ?>
32<?rfc sortrefs="yes" ?>
33<?rfc compact="yes"?>
34<?rfc subcompact="no" ?>
35<?rfc linkmailto="no" ?>
36<?rfc editing="no" ?>
37<?rfc-ext allow-markup-in-artwork="yes" ?>
38<?rfc-ext include-references-in-index="yes" ?>
39<rfc obsoletes="2068, 2616, 2617" category="std"
40     ipr="full3978" docName="draft-ietf-httpbis-p6-cache-&ID-VERSION;"
41     xmlns:x='http://purl.org/net/xml2rfc/ext' xmlns:ed="http://greenbytes.de/2002/rfcedit">
42<front>
43
44  <title abbrev="HTTP/1.1, part 6">HTTP/1.1, part 6: Caching</title>
45
46  <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
47    <organization abbrev="Day Software">Day Software</organization>
48    <address>
49      <postal>
50        <street>23 Corporate Plaza DR, Suite 280</street>
51        <city>Newport Beach</city>
52        <region>CA</region>
53        <code>92660</code>
54        <country>USA</country>
55      </postal>
56      <phone>+1-949-706-5300</phone>
57      <facsimile>+1-949-706-5305</facsimile>
58      <email>fielding@gbiv.com</email>
59      <uri>http://roy.gbiv.com/</uri>
60    </address>
61  </author>
62
63  <author initials="J." surname="Gettys" fullname="Jim Gettys">
64    <organization>One Laptop per Child</organization>
65    <address>
66      <postal>
67        <street>21 Oak Knoll Road</street>
68        <city>Carlisle</city>
69        <region>MA</region>
70        <code>01741</code>
71        <country>USA</country>
72      </postal>
73      <email>jg@laptop.org</email>
74      <uri>http://www.laptop.org/</uri>
75    </address>
76  </author>
77 
78  <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
79    <organization abbrev="HP">Hewlett-Packard Company</organization>
80    <address>
81      <postal>
82        <street>HP Labs, Large Scale Systems Group</street>
83        <street>1501 Page Mill Road, MS 1177</street>
84        <city>Palo Alto</city>
85        <region>CA</region>
86        <code>94304</code>
87        <country>USA</country>
88      </postal>
89      <email>JeffMogul@acm.org</email>
90    </address>
91  </author>
92
93  <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
94    <organization abbrev="Microsoft">Microsoft Corporation</organization>
95    <address>
96      <postal>
97        <street>1 Microsoft Way</street>
98        <city>Redmond</city>
99        <region>WA</region>
100        <code>98052</code>
101        <country>USA</country>
102      </postal>
103      <email>henrikn@microsoft.com</email>
104    </address>
105  </author>
106
107  <author initials="L." surname="Masinter" fullname="Larry Masinter">
108    <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
109    <address>
110      <postal>
111        <street>345 Park Ave</street>
112        <city>San Jose</city>
113        <region>CA</region>
114        <code>95110</code>
115        <country>USA</country>
116      </postal>
117      <email>LMM@acm.org</email>
118      <uri>http://larry.masinter.net/</uri>
119    </address>
120  </author>
121 
122  <author initials="P." surname="Leach" fullname="Paul J. Leach">
123    <organization abbrev="Microsoft">Microsoft Corporation</organization>
124    <address>
125      <postal>
126        <street>1 Microsoft Way</street>
127        <city>Redmond</city>
128        <region>WA</region>
129        <code>98052</code>
130      </postal>
131      <email>paulle@microsoft.com</email>
132    </address>
133  </author>
134   
135  <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
136    <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
137    <address>
138      <postal>
139        <street>MIT Laboratory for Computer Science</street>
140        <street>545 Technology Square</street>
141        <city>Cambridge</city>
142        <region>MA</region>
143        <code>02139</code>
144        <country>USA</country>
145      </postal>
146      <facsimile>+1 (617) 258 8682</facsimile>
147      <email>timbl@w3.org</email>
148    </address>
149  </author>
150
151  <date month="&ID-MONTH;" year="&ID-YEAR;"/>
152
153<abstract>
154<t>
155   The Hypertext Transfer Protocol (HTTP) is an application-level
156   protocol for distributed, collaborative, hypermedia information
157   systems. HTTP has been in use by the World Wide Web global information
158   initiative since 1990. This document is Part 6 of the eight-part specification
159   that defines the protocol referred to as "HTTP/1.1" and, taken together,
160   updates RFC 2616 and RFC 2617.  Part 6 defines requirements on HTTP caches
161   and the associated header fields that control cache behavior or indicate
162   cacheable response messages.
163</t>
164</abstract>
165</front>
166<middle>
167<section title="Introduction" anchor="introduction">
168<t>
169   This document will define aspects of HTTP related to caching response
170   messages.  Right now it only includes the extracted relevant sections
171   of <xref target="RFC2616">RFC 2616</xref> without edit.
172</t>
173
174<section title="Terminology" anchor="intro.terminology">
175<t>
176   This specification uses a number of terms to refer to the roles
177   played by participants in, and objects of, the HTTP communication.
178</t>
179<t>
180  <iref item="cache"/>
181  <x:dfn>cache</x:dfn>
182  <list>
183    <t>
184      A program's local store of response messages and the subsystem
185      that controls its message storage, retrieval, and deletion. A
186      cache stores cacheable responses in order to reduce the response
187      time and network bandwidth consumption on future, equivalent
188      requests. Any client or server may include a cache, though a cache
189      cannot be used by a server that is acting as a tunnel.
190    </t>
191  </list>
192</t>
193<t>
194  <iref item="cacheable"/>
195  <x:dfn>cacheable</x:dfn>
196  <list>
197    <t>
198      A response is cacheable if a cache is allowed to store a copy of
199      the response message for use in answering subsequent requests. The
200      rules for determining the cacheability of HTTP responses are
201      defined in <xref target="caching"/>. Even if a resource is cacheable, there may
202      be additional constraints on whether a cache can use the cached
203      copy for a particular request.
204    </t>
205  </list>
206</t>
207<t>
208  <iref item="first-hand"/>
209  <x:dfn>first-hand</x:dfn>
210  <list>
211    <t>
212      A response is first-hand if it comes directly and without
213      unnecessary delay from the origin server, perhaps via one or more
214      proxies. A response is also first-hand if its validity has just
215      been checked directly with the origin server.
216    </t>
217  </list>
218</t>
219<t>
220  <iref item="explicit expiration time"/>
221  <x:dfn>explicit expiration time</x:dfn>
222  <list>
223    <t>
224      The time at which the origin server intends that an entity should
225      no longer be returned by a cache without further validation.
226    </t>
227  </list>
228</t>
229<t>
230  <iref item="heuristic expiration time"/>
231  <x:dfn>heuristic expiration time</x:dfn>
232  <list>
233    <t>
234      An expiration time assigned by a cache when no explicit expiration
235      time is available.
236    </t>
237  </list>
238</t>
239<t>
240  <iref item="age"/>
241  <x:dfn>age</x:dfn>
242  <list>
243    <t>
244      The age of a response is the time since it was sent by, or
245      successfully validated with, the origin server.
246    </t>
247  </list>
248</t>
249<t>
250  <iref item="freshness lifetime"/>
251  <x:dfn>freshness lifetime</x:dfn>
252  <list>
253    <t>
254      The length of time between the generation of a response and its
255      expiration time.
256    </t>
257  </list>
258</t>
259<t>
260  <iref item="fresh"/>
261  <x:dfn>fresh</x:dfn>
262  <list>
263    <t>
264      A response is fresh if its age has not yet exceeded its freshness
265      lifetime.
266    </t>
267  </list>
268</t>
269<t>
270  <iref item="stale"/>
271  <x:dfn>stale</x:dfn>
272  <list>
273    <t>
274      A response is stale if its age has passed its freshness lifetime.
275    </t>
276  </list>
277</t>
278<t>
279  <iref item="semantically transparent"/>
280  <x:dfn>semantically transparent</x:dfn>
281  <list>
282    <t>
283      A cache behaves in a "semantically transparent" manner, with
284      respect to a particular response, when its use affects neither the
285      requesting client nor the origin server, except to improve
286      performance. When a cache is semantically transparent, the client
287      receives exactly the same response (except for hop-by-hop headers)
288      that it would have received had its request been handled directly
289      by the origin server.
290    </t>
291  </list>
292</t>
293<t>
294  <iref item="validator"/>
295  <x:dfn>validator</x:dfn>
296  <list>
297    <t>
298      A protocol element (e.g., an entity tag or a Last-Modified time)
299      that is used to find out whether a cache entry is an equivalent
300      copy of an entity.
301    </t>
302  </list>
303</t>
304</section>
305
306<section title="Delta Seconds" anchor="delta.seconds">
307<t>
308   Some HTTP header fields allow a time value to be specified as an
309   integer number of seconds, represented in decimal, after the time
310   that the message was received.
311</t>
312<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="delta-seconds"/>
313    delta-seconds  = 1*DIGIT
314</artwork></figure>
315</section>
316</section>
317
318<section title="Caching in HTTP" anchor="caching">
319<section title="Overview" anchor="caching.overview">
320<t>
321   HTTP is typically used for distributed information systems, where
322   performance can be improved by the use of response caches. The
323   HTTP/1.1 protocol includes a number of elements intended to make
324   caching work as well as possible. Because these elements are
325   inextricable from other aspects of the protocol, and because they
326   interact with each other, it is useful to describe the basic caching
327   design of HTTP separately from the detailed descriptions of methods,
328   headers, response codes, etc.
329</t>
330<t>
331   Caching would be useless if it did not significantly improve
332   performance. The goal of caching in HTTP/1.1 is to eliminate the need
333   to send requests in many cases, and to eliminate the need to send
334   full responses in many other cases. The former reduces the number of
335   network round-trips required for many operations; we use an
336   "expiration" mechanism for this purpose (see <xref target="expiration.model"/>). The
337   latter reduces network bandwidth requirements; we use a "validation"
338   mechanism for this purpose (see <xref target="validation.model"/>).
339</t>
340<t>
341   Requirements for performance, availability, and disconnected
342   operation require us to be able to relax the goal of semantic
343   transparency. The HTTP/1.1 protocol allows origin servers, caches,
344   and clients to explicitly reduce transparency when necessary.
345   However, because non-transparent operation may confuse non-expert
346   users, and might be incompatible with certain server applications
347   (such as those for ordering merchandise), the protocol requires that
348   transparency be relaxed
349  <list style="symbols">
350     <t>only by an explicit protocol-level request when relaxed by
351        client or origin server</t>
352
353     <t>only with an explicit warning to the end user when relaxed by
354        cache or client</t>
355  </list>
356</t>
357<t>
358   Therefore, the HTTP/1.1 protocol provides these important elements:
359  <list style="numbers">
360      <t>Protocol features that provide full semantic transparency when
361         this is required by all parties.</t>
362
363      <t>Protocol features that allow an origin server or user agent to
364         explicitly request and control non-transparent operation.</t>
365
366      <t>Protocol features that allow a cache to attach warnings to
367         responses that do not preserve the requested approximation of
368         semantic transparency.</t>
369  </list>
370</t>
371<t>
372   A basic principle is that it must be possible for the clients to
373   detect any potential relaxation of semantic transparency.
374  <list><t>
375      <x:h>Note:</x:h> The server, cache, or client implementor might be faced with
376      design decisions not explicitly discussed in this specification.
377      If a decision might affect semantic transparency, the implementor
378      ought to err on the side of maintaining transparency unless a
379      careful and complete analysis shows significant benefits in
380      breaking transparency.
381    </t></list>
382</t>
383
384<section title="Cache Correctness" anchor="cache.correctness">
385<t>
386   A correct cache &MUST; respond to a request with the most up-to-date
387   response held by the cache that is appropriate to the request (see
388   sections <xref target="disambiguating.expiration.values" format="counter"/>,
389   <xref target="disambiguating.multiple.responses" format="counter"/>,
390   and <xref target="cache.replacement" format="counter"/>) which meets one of the following
391   conditions:
392  <list style="numbers">
393      <t>It has been checked for equivalence with what the origin server
394         would have returned by revalidating the response with the
395         origin server (<xref target="validation.model"/>);</t>
396
397      <t>It is "fresh enough" (see <xref target="expiration.model"/>). In the default case,
398         this means it meets the least restrictive freshness requirement
399         of the client, origin server, and cache (see <xref target="header.cache-control"/>); if
400         the origin server so specifies, it is the freshness requirement
401         of the origin server alone.
402
403         If a stored response is not "fresh enough" by the most
404         restrictive freshness requirement of both the client and the
405         origin server, in carefully considered circumstances the cache
406         &MAY; still return the response with the appropriate Warning
407         header (see section <xref target="exceptions.to.the.rules.and.warnings" format="counter"/>
408         and <xref target="header.warning" format="counter"/>), unless such a response
409         is prohibited (e.g., by a "no-store" cache-directive, or by a
410         "no-cache" cache-request-directive; see <xref target="header.cache-control"/>).</t>
411
412      <t>It is an appropriate 304 (Not Modified), 305 (Proxy Redirect),
413         or error (4xx or 5xx) response message.</t>
414  </list>
415</t>
416<t>
417   If the cache can not communicate with the origin server, then a
418   correct cache &SHOULD; respond as above if the response can be
419   correctly served from the cache; if not it &MUST; return an error or
420   warning indicating that there was a communication failure.
421</t>
422<t>
423   If a cache receives a response (either an entire response, or a 304
424   (Not Modified) response) that it would normally forward to the
425   requesting client, and the received response is no longer fresh, the
426   cache &SHOULD; forward it to the requesting client without adding a new
427   Warning (but without removing any existing Warning headers). A cache
428   &SHOULD-NOT;  attempt to revalidate a response simply because that
429   response became stale in transit; this might lead to an infinite
430   loop. A user agent that receives a stale response without a Warning
431   &MAY; display a warning indication to the user.
432</t>
433</section>
434
435<section title="Warnings" anchor="warnings">
436<t>
437   Whenever a cache returns a response that is neither first-hand nor
438   "fresh enough" (in the sense of condition 2 in <xref target="cache.correctness"/>), it
439   &MUST; attach a warning to that effect, using a Warning general-header.
440   The Warning header and the currently defined warnings are described
441   in <xref target="header.warning"/>. The warning allows clients to take appropriate
442   action.
443</t>
444<t>
445   Warnings &MAY; be used for other purposes, both cache-related and
446   otherwise. The use of a warning, rather than an error status code,
447   distinguish these responses from true failures.
448</t>
449<t>
450   Warnings are assigned three digit warn-codes. The first digit
451   indicates whether the Warning &MUST; or &MUST-NOT; be deleted from a
452   stored cache entry after a successful revalidation:
453</t>
454<t>
455  <list style="hanging">
456    <t hangText="1xx">Warnings that describe the freshness or revalidation status of
457     the response, and so &MUST; be deleted after a successful
458     revalidation. 1XX warn-codes &MAY; be generated by a cache only when
459     validating a cached entry. It &MUST-NOT; be generated by clients.</t>
460
461    <t hangText="2xx">Warnings that describe some aspect of the entity body or entity
462     headers that is not rectified by a revalidation (for example, a
463     lossy compression of the entity bodies) and which &MUST-NOT; be
464     deleted after a successful revalidation.</t>
465    </list>
466</t>
467<t>
468   See <xref target="header.warning"/> for the definitions of the codes themselves.
469</t>
470<t>
471   HTTP/1.0 caches will cache all Warnings in responses, without
472   deleting the ones in the first category. Warnings in responses that
473   are passed to HTTP/1.0 caches carry an extra warning-date field,
474   which prevents a future HTTP/1.1 recipient from believing an
475   erroneously cached Warning.
476</t>
477<t>
478   Warnings also carry a warning text. The text &MAY; be in any
479   appropriate natural language (perhaps based on the client's Accept
480   headers), and include an &OPTIONAL; indication of what character set is
481   used.
482</t>
483<t>
484   Multiple warnings &MAY; be attached to a response (either by the origin
485   server or by a cache), including multiple warnings with the same code
486   number. For example, a server might provide the same warning with
487   texts in both English and Basque.
488</t>
489<t>
490   When multiple warnings are attached to a response, it might not be
491   practical or reasonable to display all of them to the user. This
492   version of HTTP does not specify strict priority rules for deciding
493   which warnings to display and in what order, but does suggest some
494   heuristics.
495</t>
496</section>
497
498<section title="Cache-control Mechanisms" anchor="cache-control.mechanisms">
499<t>
500   The basic cache mechanisms in HTTP/1.1 (server-specified expiration
501   times and validators) are implicit directives to caches. In some
502   cases, a server or client might need to provide explicit directives
503   to the HTTP caches. We use the Cache-Control header for this purpose.
504</t>
505<t>
506   The Cache-Control header allows a client or server to transmit a
507   variety of directives in either requests or responses. These
508   directives typically override the default caching algorithms. As a
509   general rule, if there is any apparent conflict between header
510   values, the most restrictive interpretation is applied (that is, the
511   one that is most likely to preserve semantic transparency). However,
512   in some cases, cache-control directives are explicitly specified as
513   weakening the approximation of semantic transparency (for example,
514   "max-stale" or "public").
515</t>
516<t>
517   The cache-control directives are described in detail in <xref target="header.cache-control"/>.
518</t>
519</section>
520
521<section title="Explicit User Agent Warnings" anchor="explicit.ua.warnings">
522<t>
523   Many user agents make it possible for users to override the basic
524   caching mechanisms. For example, the user agent might allow the user
525   to specify that cached entities (even explicitly stale ones) are
526   never validated. Or the user agent might habitually add "Cache-Control:
527   max-stale=3600" to every request. The user agent &SHOULD-NOT;
528   default to either non-transparent behavior, or behavior that results
529   in abnormally ineffective caching, but &MAY; be explicitly configured
530   to do so by an explicit action of the user.
531</t>
532<t>
533   If the user has overridden the basic caching mechanisms, the user
534   agent &SHOULD; explicitly indicate to the user whenever this results in
535   the display of information that might not meet the server's
536   transparency requirements (in particular, if the displayed entity is
537   known to be stale). Since the protocol normally allows the user agent
538   to determine if responses are stale or not, this indication need only
539   be displayed when this actually happens. The indication need not be a
540   dialog box; it could be an icon (for example, a picture of a rotting
541   fish) or some other indicator.
542</t>
543<t>
544   If the user has overridden the caching mechanisms in a way that would
545   abnormally reduce the effectiveness of caches, the user agent &SHOULD;
546   continually indicate this state to the user (for example, by a
547   display of a picture of currency in flames) so that the user does not
548   inadvertently consume excess resources or suffer from excessive
549   latency.
550</t>
551</section>
552
553<section title="Exceptions to the Rules and Warnings" anchor="exceptions.to.the.rules.and.warnings">
554<t>
555   In some cases, the operator of a cache &MAY; choose to configure it to
556   return stale responses even when not requested by clients. This
557   decision ought not be made lightly, but may be necessary for reasons
558   of availability or performance, especially when the cache is poorly
559   connected to the origin server. Whenever a cache returns a stale
560   response, it &MUST; mark it as such (using a Warning header) enabling
561   the client software to alert the user that there might be a potential
562   problem.
563</t>
564<t>
565   It also allows the user agent to take steps to obtain a first-hand or
566   fresh response. For this reason, a cache &SHOULD-NOT;  return a stale
567   response if the client explicitly requests a first-hand or fresh one,
568   unless it is impossible to comply for technical or policy reasons.
569</t>
570</section>
571
572<section title="Client-controlled Behavior" anchor="client-controlled.behavior">
573<t>
574   While the origin server (and to a lesser extent, intermediate caches,
575   by their contribution to the age of a response) are the primary
576   source of expiration information, in some cases the client might need
577   to control a cache's decision about whether to return a cached
578   response without validating it. Clients do this using several
579   directives of the Cache-Control header.
580</t>
581<t>
582   A client's request &MAY; specify the maximum age it is willing to
583   accept of an unvalidated response; specifying a value of zero forces
584   the cache(s) to revalidate all responses. A client &MAY; also specify
585   the minimum time remaining before a response expires. Both of these
586   options increase constraints on the behavior of caches, and so cannot
587   further relax the cache's approximation of semantic transparency.
588</t>
589<t>
590   A client &MAY; also specify that it will accept stale responses, up to
591   some maximum amount of staleness. This loosens the constraints on the
592   caches, and so might violate the origin server's specified
593   constraints on semantic transparency, but might be necessary to
594   support disconnected operation, or high availability in the face of
595   poor connectivity.
596</t>
597</section>
598</section>
599
600<section title="Expiration Model" anchor="expiration.model">
601
602<section title="Server-Specified Expiration" anchor="server-specified.expiration">
603<t>
604   HTTP caching works best when caches can entirely avoid making
605   requests to the origin server. The primary mechanism for avoiding
606   requests is for an origin server to provide an explicit expiration
607   time in the future, indicating that a response &MAY; be used to satisfy
608   subsequent requests. In other words, a cache can return a fresh
609   response without first contacting the server.
610</t>
611<t>
612   Our expectation is that servers will assign future explicit
613   expiration times to responses in the belief that the entity is not
614   likely to change, in a semantically significant way, before the
615   expiration time is reached. This normally preserves semantic
616   transparency, as long as the server's expiration times are carefully
617   chosen.
618</t>
619<t>
620   The expiration mechanism applies only to responses taken from a cache
621   and not to first-hand responses forwarded immediately to the
622   requesting client.
623</t>
624<t>
625   If an origin server wishes to force a semantically transparent cache
626   to validate every request, it &MAY; assign an explicit expiration time
627   in the past. This means that the response is always stale, and so the
628   cache &SHOULD; validate it before using it for subsequent requests. See
629   <xref target="cache.revalidation.and.reload.controls"/> for a more restrictive way to force revalidation.
630</t>
631<t>
632   If an origin server wishes to force any HTTP/1.1 cache, no matter how
633   it is configured, to validate every request, it &SHOULD; use the "must-revalidate"
634   cache-control directive (see <xref target="header.cache-control"/>).
635</t>
636<t>
637   Servers specify explicit expiration times using either the Expires
638   header, or the max-age directive of the Cache-Control header.
639</t>
640<t>
641   An expiration time cannot be used to force a user agent to refresh
642   its display or reload a resource; its semantics apply only to caching
643   mechanisms, and such mechanisms need only check a resource's
644   expiration status when a new request for that resource is initiated.
645   See <xref target="history.lists"/> for an explanation of the difference between caches
646   and history mechanisms.
647</t>
648</section>
649
650<section title="Heuristic Expiration" anchor="heuristic.expiration">
651<t>
652   Since origin servers do not always provide explicit expiration times,
653   HTTP caches typically assign heuristic expiration times, employing
654   algorithms that use other header values (such as the Last-Modified
655   time) to estimate a plausible expiration time. The HTTP/1.1
656   specification does not provide specific algorithms, but does impose
657   worst-case constraints on their results. Since heuristic expiration
658   times might compromise semantic transparency, they ought to used
659   cautiously, and we encourage origin servers to provide explicit
660   expiration times as much as possible.
661</t>
662</section>
663
664<section title="Age Calculations" anchor="age.calculations">
665<t>
666   In order to know if a cached entry is fresh, a cache needs to know if
667   its age exceeds its freshness lifetime. We discuss how to calculate
668   the latter in <xref target="expiration.calculations"/>; this section describes how to calculate
669   the age of a response or cache entry.
670</t>
671<t>
672   In this discussion, we use the term "now" to mean "the current value
673   of the clock at the host performing the calculation." Hosts that use
674   HTTP, but especially hosts running origin servers and caches, &SHOULD;
675   use NTP <xref target="RFC1305"/> or some similar protocol to synchronize their clocks to
676   a globally accurate time standard.
677</t>
678<t>
679   HTTP/1.1 requires origin servers to send a Date header, if possible,
680   with every response, giving the time at which the response was
681   generated (see &header-date;). We use the term "date_value" to denote
682   the value of the Date header, in a form appropriate for arithmetic
683   operations.
684</t>
685<t>
686   HTTP/1.1 uses the Age response-header to convey the estimated age of
687   the response message when obtained from a cache. The Age field value
688   is the cache's estimate of the amount of time since the response was
689   generated or revalidated by the origin server.
690</t>
691<t>
692   In essence, the Age value is the sum of the time that the response
693   has been resident in each of the caches along the path from the
694   origin server, plus the amount of time it has been in transit along
695   network paths.
696</t>
697<t>
698   We use the term "age_value" to denote the value of the Age header, in
699   a form appropriate for arithmetic operations.
700</t>
701<t>
702   A response's age can be calculated in two entirely independent ways:
703  <list style="numbers">
704      <t>now minus date_value, if the local clock is reasonably well
705         synchronized to the origin server's clock. If the result is
706         negative, the result is replaced by zero.</t>
707
708      <t>age_value, if all of the caches along the response path
709         implement HTTP/1.1.</t>
710  </list>
711</t>
712<t>
713   Given that we have two independent ways to compute the age of a
714   response when it is received, we can combine these as
715</t>
716<figure><artwork type="code">
717    corrected_received_age = max(now - date_value, age_value)
718</artwork></figure>
719<t>
720   and as long as we have either nearly synchronized clocks or all-HTTP/1.1
721   paths, one gets a reliable (conservative) result.
722</t>
723<t>
724   Because of network-imposed delays, some significant interval might
725   pass between the time that a server generates a response and the time
726   it is received at the next outbound cache or client. If uncorrected,
727   this delay could result in improperly low ages.
728</t>
729<t>
730   Because the request that resulted in the returned Age value must have
731   been initiated prior to that Age value's generation, we can correct
732   for delays imposed by the network by recording the time at which the
733   request was initiated. Then, when an Age value is received, it &MUST;
734   be interpreted relative to the time the request was initiated, not
735   the time that the response was received. This algorithm results in
736   conservative behavior no matter how much delay is experienced. So, we
737   compute:
738</t>
739<figure><artwork type="code">
740   corrected_initial_age = corrected_received_age
741                         + (now - request_time)
742</artwork></figure>
743<t>
744   where "request_time" is the time (according to the local clock) when
745   the request that elicited this response was sent.
746</t>
747<t>
748   Summary of age calculation algorithm, when a cache receives a
749   response:
750</t>
751<figure><artwork type="code">
752   /*
753    * age_value
754    *      is the value of Age: header received by the cache with
755    *              this response.
756    * date_value
757    *      is the value of the origin server's Date: header
758    * request_time
759    *      is the (local) time when the cache made the request
760    *              that resulted in this cached response
761    * response_time
762    *      is the (local) time when the cache received the
763    *              response
764    * now
765    *      is the current (local) time
766    */
767
768   apparent_age = max(0, response_time - date_value);
769   corrected_received_age = max(apparent_age, age_value);
770   response_delay = response_time - request_time;
771   corrected_initial_age = corrected_received_age + response_delay;
772   resident_time = now - response_time;
773   current_age   = corrected_initial_age + resident_time;
774</artwork></figure>
775<t>
776   The current_age of a cache entry is calculated by adding the amount
777   of time (in seconds) since the cache entry was last validated by the
778   origin server to the corrected_initial_age. When a response is
779   generated from a cache entry, the cache &MUST; include a single Age
780   header field in the response with a value equal to the cache entry's
781   current_age.
782</t>
783<t>
784   The presence of an Age header field in a response implies that a
785   response is not first-hand. However, the converse is not true, since
786   the lack of an Age header field in a response does not imply that the
787   response is first-hand unless all caches along the request path are
788   compliant with HTTP/1.1 (i.e., older HTTP caches did not implement
789   the Age header field).
790</t>
791</section>
792
793<section title="Expiration Calculations" anchor="expiration.calculations">
794<t>
795   In order to decide whether a response is fresh or stale, we need to
796   compare its freshness lifetime to its age. The age is calculated as
797   described in <xref target="age.calculations"/>; this section describes how to calculate
798   the freshness lifetime, and to determine if a response has expired.
799   In the discussion below, the values can be represented in any form
800   appropriate for arithmetic operations.
801</t>
802<t>
803   We use the term "expires_value" to denote the value of the Expires
804   header. We use the term "max_age_value" to denote an appropriate
805   value of the number of seconds carried by the "max-age" directive of
806   the Cache-Control header in a response (see <xref target="modifications.of.the.basic.expiration.mechanism"/>).
807</t>
808<t>
809   The max-age directive takes priority over Expires, so if max-age is
810   present in a response, the calculation is simply:
811</t>
812<figure><artwork type="code">
813   freshness_lifetime = max_age_value
814</artwork></figure>
815<t>
816   Otherwise, if Expires is present in the response, the calculation is:
817</t>
818<figure><artwork type="code">
819   freshness_lifetime = expires_value - date_value
820</artwork></figure>
821<t>
822   Note that neither of these calculations is vulnerable to clock skew,
823   since all of the information comes from the origin server.
824</t>
825<t>
826   If none of Expires, Cache-Control: max-age, or Cache-Control: s-maxage
827   (see <xref target="modifications.of.the.basic.expiration.mechanism"/>) appears in the response, and the response
828   does not include other restrictions on caching, the cache &MAY; compute
829   a freshness lifetime using a heuristic. The cache &MUST; attach Warning
830   113 to any response whose age is more than 24 hours if such warning
831   has not already been added.
832</t>
833<t>
834   Also, if the response does have a Last-Modified time, the heuristic
835   expiration value &SHOULD; be no more than some fraction of the interval
836   since that time. A typical setting of this fraction might be 10%.
837</t>
838<t>
839   The calculation to determine if a response has expired is quite
840   simple:
841</t>
842<figure><artwork type="code">
843   response_is_fresh = (freshness_lifetime &gt; current_age)
844</artwork></figure>
845</section>
846
847<section title="Disambiguating Expiration Values" anchor="disambiguating.expiration.values">
848<t>
849   Because expiration values are assigned optimistically, it is possible
850   for two caches to contain fresh values for the same resource that are
851   different.
852</t>
853<t>
854   If a client performing a retrieval receives a non-first-hand response
855   for a request that was already fresh in its own cache, and the Date
856   header in its existing cache entry is newer than the Date on the new
857   response, then the client &MAY; ignore the response. If so, it &MAY;
858   retry the request with a "Cache-Control: max-age=0" directive (see
859   <xref target="header.cache-control"/>), to force a check with the origin server.
860</t>
861<t>
862   If a cache has two fresh responses for the same representation with
863   different validators, it &MUST; use the one with the more recent Date
864   header. This situation might arise because the cache is pooling
865   responses from other caches, or because a client has asked for a
866   reload or a revalidation of an apparently fresh cache entry.
867</t>
868</section>
869
870<section title="Disambiguating Multiple Responses" anchor="disambiguating.multiple.responses">
871<t>
872   Because a client might be receiving responses via multiple paths, so
873   that some responses flow through one set of caches and other
874   responses flow through a different set of caches, a client might
875   receive responses in an order different from that in which the origin
876   server sent them. We would like the client to use the most recently
877   generated response, even if older responses are still apparently
878   fresh.
879</t>
880<t>
881   Neither the entity tag nor the expiration value can impose an
882   ordering on responses, since it is possible that a later response
883   intentionally carries an earlier expiration time. The Date values are
884   ordered to a granularity of one second.
885</t>
886<t>
887   When a client tries to revalidate a cache entry, and the response it
888   receives contains a Date header that appears to be older than the one
889   for the existing entry, then the client &SHOULD; repeat the request
890   unconditionally, and include
891</t>
892<figure><artwork type="example">
893    Cache-Control: max-age=0
894</artwork></figure>
895<t>
896   to force any intermediate caches to validate their copies directly
897   with the origin server, or
898</t>
899<figure><artwork type="example">
900    Cache-Control: no-cache
901</artwork></figure>
902<t>
903   to force any intermediate caches to obtain a new copy from the origin
904   server.
905</t>
906<t>
907   If the Date values are equal, then the client &MAY; use either response
908   (or &MAY;, if it is being extremely prudent, request a new response).
909   Servers &MUST-NOT; depend on clients being able to choose
910   deterministically between responses generated during the same second,
911   if their expiration times overlap.
912</t>
913</section>
914</section>
915
916<section title="Validation Model" anchor="validation.model">
917<t>
918   When a cache has a stale entry that it would like to use as a
919   response to a client's request, it first has to check with the origin
920   server (or possibly an intermediate cache with a fresh response) to
921   see if its cached entry is still usable. We call this "validating"
922   the cache entry. Since we do not want to have to pay the overhead of
923   retransmitting the full response if the cached entry is good, and we
924   do not want to pay the overhead of an extra round trip if the cached
925   entry is invalid, the HTTP/1.1 protocol supports the use of
926   conditional methods.
927</t>
928<t>
929   The key protocol features for supporting conditional methods are
930   those concerned with "cache validators." When an origin server
931   generates a full response, it attaches some sort of validator to it,
932   which is kept with the cache entry. When a client (user agent or
933   proxy cache) makes a conditional request for a resource for which it
934   has a cache entry, it includes the associated validator in the
935   request.
936</t>
937<t>
938   The server then checks that validator against the current validator
939   for the entity, and, if they match (see &weak-and-strong-validators;), it responds
940   with a special status code (usually, 304 (Not Modified)) and no
941   entity-body. Otherwise, it returns a full response (including
942   entity-body). Thus, we avoid transmitting the full response if the
943   validator matches, and we avoid an extra round trip if it does not
944   match.
945</t>
946<t>
947   In HTTP/1.1, a conditional request looks exactly the same as a normal
948   request for the same resource, except that it carries a special
949   header (which includes the validator) that implicitly turns the
950   method (usually, GET) into a conditional.
951</t>
952<t>
953   The protocol includes both positive and negative senses of cache-validating
954   conditions. That is, it is possible to request either that
955   a method be performed if and only if a validator matches or if and
956   only if no validators match.
957  <list><t>
958      <x:h>Note:</x:h> a response that lacks a validator may still be cached, and
959      served from cache until it expires, unless this is explicitly
960      prohibited by a cache-control directive. However, a cache cannot
961      do a conditional retrieval if it does not have a validator for the
962      entity, which means it will not be refreshable after it expires.
963  </t></list>
964</t>
965
966<section title="Last-Modified Dates" anchor="last-modified.dates">
967<t>
968   The Last-Modified entity-header field value is often used as a cache
969   validator. In simple terms, a cache entry is considered to be valid
970   if the entity has not been modified since the Last-Modified value.
971</t>
972</section>
973
974<section title="Entity Tag Cache Validators" anchor="entity.tag.cache.validators">
975<t>
976   The ETag response-header field value, an entity tag, provides for an
977   "opaque" cache validator. This might allow more reliable validation
978   in situations where it is inconvenient to store modification dates,
979   where the one-second resolution of HTTP date values is not
980   sufficient, or where the origin server wishes to avoid certain
981   paradoxes that might arise from the use of modification dates.
982</t>
983<t>
984   Entity Tags are described in &entity-tags;.
985</t>
986</section>
987
988<section title="Non-validating Conditionals" anchor="non-validating.conditionals">
989<t>
990   The principle behind entity tags is that only the service author
991   knows the semantics of a resource well enough to select an
992   appropriate cache validation mechanism, and the specification of any
993   validator comparison function more complex than byte-equality would
994   open up a can of worms. Thus, comparisons of any other headers
995   (except Last-Modified, for compatibility with HTTP/1.0) are never
996   used for purposes of validating a cache entry.
997</t>
998</section>
999</section>
1000
1001<section title="Response Cacheability" anchor="response.cacheability">
1002<t>
1003   Unless specifically constrained by a cache-control (<xref target="header.cache-control"/>)
1004   directive, a caching system &MAY; always store a successful response
1005   (see <xref target="errors.or.incomplete.response.cache.behavior"/>) as a cache entry, &MAY; return it without validation
1006   if it is fresh, and &MAY; return it after successful validation. If
1007   there is neither a cache validator nor an explicit expiration time
1008   associated with a response, we do not expect it to be cached, but
1009   certain caches &MAY; violate this expectation (for example, when little
1010   or no network connectivity is available). A client can usually detect
1011   that such a response was taken from a cache by comparing the Date
1012   header to the current time.
1013  <list><t>
1014      <x:h>Note:</x:h> some HTTP/1.0 caches are known to violate this expectation
1015      without providing any Warning.
1016  </t></list>
1017</t>
1018<t>
1019   However, in some cases it might be inappropriate for a cache to
1020   retain an entity, or to return it in response to a subsequent
1021   request. This might be because absolute semantic transparency is
1022   deemed necessary by the service author, or because of security or
1023   privacy considerations. Certain cache-control directives are
1024   therefore provided so that the server can indicate that certain
1025   resource entities, or portions thereof, are not to be cached
1026   regardless of other considerations.
1027</t>
1028<t>
1029   Note that &header-authorization; normally prevents a shared cache from saving
1030   and returning a response to a previous request if that request
1031   included an Authorization header.
1032</t>
1033<t>
1034   A response received with a status code of 200, 203, 206, 300, 301 or
1035   410 &MAY; be stored by a cache and used in reply to a subsequent
1036   request, subject to the expiration mechanism, unless a cache-control
1037   directive prohibits caching. However, a cache that does not support
1038   the Range and Content-Range headers &MUST-NOT; cache 206 (Partial
1039   Content) responses.
1040</t>
1041<t>
1042   A response received with any other status code (e.g. status codes 302
1043   and 307) &MUST-NOT; be returned in a reply to a subsequent request
1044   unless there are cache-control directives or another header(s) that
1045   explicitly allow it. For example, these include the following: an
1046   Expires header (<xref target="header.expires"/>); a "max-age", "s-maxage",  "must-revalidate",
1047   "proxy-revalidate", "public" or "private" cache-control
1048   directive (<xref target="header.cache-control"/>).
1049</t>
1050</section>
1051
1052<section title="Constructing Responses From Caches" anchor="constructing.responses.from.caches">
1053<t>
1054   The purpose of an HTTP cache is to store information received in
1055   response to requests for use in responding to future requests. In
1056   many cases, a cache simply returns the appropriate parts of a
1057   response to the requester. However, if the cache holds a cache entry
1058   based on a previous response, it might have to combine parts of a new
1059   response with what is held in the cache entry.
1060</t>
1061
1062<section title="End-to-end and Hop-by-hop Headers" anchor="end-to-end.and.hop-by-hop.headers">
1063<t>
1064   For the purpose of defining the behavior of caches and non-caching
1065   proxies, we divide HTTP headers into two categories:
1066  <list style="symbols">
1067      <t>End-to-end headers, which are  transmitted to the ultimate
1068        recipient of a request or response. End-to-end headers in
1069        responses &MUST; be stored as part of a cache entry and &MUST; be
1070        transmitted in any response formed from a cache entry.</t>
1071
1072      <t>Hop-by-hop headers, which are meaningful only for a single
1073        transport-level connection, and are not stored by caches or
1074        forwarded by proxies.</t>
1075  </list>
1076</t>
1077<t>
1078   The following HTTP/1.1 headers are hop-by-hop headers:
1079  <list style="symbols">
1080      <t>Connection</t>
1081      <t>Keep-Alive</t>
1082      <t>Proxy-Authenticate</t>
1083      <t>Proxy-Authorization</t>
1084      <t>TE</t>
1085      <t>Trailers</t>
1086      <t>Transfer-Encoding</t>
1087      <t>Upgrade</t>
1088  </list>
1089</t>
1090<t>
1091   All other headers defined by HTTP/1.1 are end-to-end headers.
1092</t>
1093<t>
1094   Other hop-by-hop headers &MUST; be listed in a Connection header,
1095   (&header-connection;) to be introduced into HTTP/1.1 (or later).
1096</t>
1097</section>
1098
1099<section title="Non-modifiable Headers" anchor="non-modifiable.headers">
1100<t>
1101   Some features of the HTTP/1.1 protocol, such as Digest
1102   Authentication, depend on the value of certain end-to-end headers. A
1103   transparent proxy &SHOULD-NOT;  modify an end-to-end header unless the
1104   definition of that header requires or specifically allows that.
1105</t>
1106<t>
1107   A transparent proxy &MUST-NOT; modify any of the following fields in a
1108   request or response, and it &MUST-NOT; add any of these fields if not
1109   already present:
1110  <list style="symbols">
1111      <t>Content-Location</t>
1112      <t>Content-MD5</t>
1113      <t>ETag</t>
1114      <t>Last-Modified</t>
1115  </list>
1116</t>
1117<t>
1118   A transparent proxy &MUST-NOT; modify any of the following fields in a
1119   response:
1120  <list style="symbols">
1121    <t>Expires</t>
1122  </list>
1123</t>
1124<t>
1125   but it &MAY; add any of these fields if not already present. If an
1126   Expires header is added, it &MUST; be given a field-value identical to
1127   that of the Date header in that response.
1128</t>
1129<t>
1130   A  proxy &MUST-NOT; modify or add any of the following fields in a
1131   message that contains the no-transform cache-control directive, or in
1132   any request:
1133  <list style="symbols">
1134    <t>Content-Encoding</t>
1135    <t>Content-Range</t>
1136    <t>Content-Type</t>
1137  </list>
1138</t>
1139<t>
1140   A non-transparent proxy &MAY; modify or add these fields to a message
1141   that does not include no-transform, but if it does so, it &MUST; add a
1142   Warning 214 (Transformation applied) if one does not already appear
1143   in the message (see <xref target="header.warning"/>).
1144  <list><t>
1145      Warning: unnecessary modification of end-to-end headers might
1146      cause authentication failures if stronger authentication
1147      mechanisms are introduced in later versions of HTTP. Such
1148      authentication mechanisms &MAY; rely on the values of header fields
1149      not listed here.
1150    </t></list>
1151</t>
1152<t>
1153   The Content-Length field of a request or response is added or deleted
1154   according to the rules in &message-length;. A transparent proxy &MUST;
1155   preserve the entity-length (&entity-length;) of the entity-body,
1156   although it &MAY; change the transfer-length (&message-length;).
1157</t>
1158</section>
1159
1160<section title="Combining Headers" anchor="combining.headers">
1161<t>
1162   When a cache makes a validating request to a server, and the server
1163   provides a 304 (Not Modified) response or a 206 (Partial Content)
1164   response, the cache then constructs a response to send to the
1165   requesting client.
1166</t>
1167<t>
1168   If the status code is 304 (Not Modified), the cache uses the entity-body
1169   stored in the cache entry as the entity-body of this outgoing
1170   response. If the status code is 206 (Partial Content) and the ETag or
1171   Last-Modified headers match exactly, the cache &MAY; combine the
1172   contents stored in the cache entry with the new contents received in
1173   the response and use the result as the entity-body of this outgoing
1174   response, (see &combining-byte-ranges;).
1175</t>
1176<t>
1177   The end-to-end headers stored in the cache entry are used for the
1178   constructed response, except that
1179  <list style="symbols">
1180    <t>any stored Warning headers with warn-code 1xx (see <xref target="header.warning"/>)
1181      &MUST; be deleted from the cache entry and the forwarded response.</t>
1182    <t>any stored Warning headers with warn-code 2xx &MUST; be retained
1183        in the cache entry and the forwarded response.</t>
1184    <t>any end-to-end headers provided in the 304 or 206 response &MUST;
1185        replace the corresponding headers from the cache entry.</t>
1186  </list>
1187</t>
1188<t>
1189   Unless the cache decides to remove the cache entry, it &MUST; also
1190   replace the end-to-end headers stored with the cache entry with
1191   corresponding headers received in the incoming response, except for
1192   Warning headers as described immediately above. If a header field-name
1193   in the incoming response matches more than one header in the
1194   cache entry, all such old headers &MUST; be replaced.
1195</t>
1196<t>
1197   In other words, the set of end-to-end headers received in the
1198   incoming response overrides all corresponding end-to-end headers
1199   stored with the cache entry (except for stored Warning headers with
1200   warn-code 1xx, which are deleted even if not overridden).
1201  <list><t>
1202      <x:h>Note:</x:h> this rule allows an origin server to use a 304 (Not
1203      Modified) or a 206 (Partial Content) response to update any header
1204      associated with a previous response for the same entity or sub-ranges
1205      thereof, although it might not always be meaningful or
1206      correct to do so. This rule does not allow an origin server to use
1207      a 304 (Not Modified) or a 206 (Partial Content) response to
1208      entirely delete a header that it had provided with a previous
1209      response.
1210  </t></list>
1211</t>
1212</section>
1213
1214</section>
1215
1216<section title="Caching Negotiated Responses" anchor="caching.negotiated.responses">
1217<t>
1218   Use of server-driven content negotiation (&server-driven-negotiation;), as indicated
1219   by the presence of a Vary header field in a response, alters the
1220   conditions and procedure by which a cache can use the response for
1221   subsequent requests. See <xref target="header.vary"/> for use of the Vary header
1222   field by servers.
1223</t>
1224<t>
1225   A server &SHOULD; use the Vary header field to inform a cache of what
1226   request-header fields were used to select among multiple
1227   representations of a cacheable response subject to server-driven
1228   negotiation. The set of header fields named by the Vary field value
1229   is known as the "selecting" request-headers.
1230</t>
1231<t>
1232   When the cache receives a subsequent request whose Request-URI
1233   specifies one or more cache entries including a Vary header field,
1234   the cache &MUST-NOT; use such a cache entry to construct a response to
1235   the new request unless all of the selecting request-headers present
1236   in the new request match the corresponding stored request-headers in
1237   the original request.
1238</t>
1239<t>
1240   The selecting request-headers from two requests are defined to match
1241   if and only if the selecting request-headers in the first request can
1242   be transformed to the selecting request-headers in the second request
1243   by adding or removing linear white space (LWS) at places where this
1244   is allowed by the corresponding BNF, and/or combining multiple
1245   message-header fields with the same field name following the rules
1246   about message headers in &message-headers;.
1247</t>
1248<t>
1249   A Vary header field-value of "*" always fails to match and subsequent
1250   requests on that resource can only be properly interpreted by the
1251   origin server.
1252</t>
1253<t>
1254   If the selecting request header fields for the cached entry do not
1255   match the selecting request header fields of the new request, then
1256   the cache &MUST-NOT; use a cached entry to satisfy the request unless
1257   it first relays the new request to the origin server in a conditional
1258   request and the server responds with 304 (Not Modified), including an
1259   entity tag or Content-Location that indicates the entity to be used.
1260</t>
1261<t>
1262   If an entity tag was assigned to a cached representation, the
1263   forwarded request &SHOULD; be conditional and include the entity tags
1264   in an If-None-Match header field from all its cache entries for the
1265   resource. This conveys to the server the set of entities currently
1266   held by the cache, so that if any one of these entities matches the
1267   requested entity, the server can use the ETag header field in its 304
1268   (Not Modified) response to tell the cache which entry is appropriate.
1269   If the entity-tag of the new response matches that of an existing
1270   entry, the new response &SHOULD; be used to update the header fields of
1271   the existing entry, and the result &MUST; be returned to the client.
1272</t>
1273<t>
1274   If any of the existing cache entries contains only partial content
1275   for the associated entity, its entity-tag &SHOULD-NOT;  be included in
1276   the If-None-Match header field unless the request is for a range that
1277   would be fully satisfied by that entry.
1278</t>
1279<t>
1280   If a cache receives a successful response whose Content-Location
1281   field matches that of an existing cache entry for the same Request-URI,
1282   whose entity-tag differs from that of the existing entry, and
1283   whose Date is more recent than that of the existing entry, the
1284   existing entry &SHOULD-NOT;  be returned in response to future requests
1285   and &SHOULD; be deleted from the cache.
1286</t>
1287</section>
1288
1289<section title="Shared and Non-Shared Caches" anchor="shared.and.non-shared.caches">
1290<t>
1291   For reasons of security and privacy, it is necessary to make a
1292   distinction between "shared" and "non-shared" caches. A non-shared
1293   cache is one that is accessible only to a single user. Accessibility
1294   in this case &SHOULD; be enforced by appropriate security mechanisms.
1295   All other caches are considered to be "shared." Other sections of
1296   this specification place certain constraints on the operation of
1297   shared caches in order to prevent loss of privacy or failure of
1298   access controls.
1299</t>
1300</section>
1301
1302<section title="Errors or Incomplete Response Cache Behavior" anchor="errors.or.incomplete.response.cache.behavior">
1303<t>
1304   A cache that receives an incomplete response (for example, with fewer
1305   bytes of data than specified in a Content-Length header) &MAY; store
1306   the response. However, the cache &MUST; treat this as a partial
1307   response. Partial responses &MAY; be combined as described in &combining-byte-ranges;;
1308   the result might be a full response or might still be
1309   partial. A cache &MUST-NOT; return a partial response to a client
1310   without explicitly marking it as such, using the 206 (Partial
1311   Content) status code. A cache &MUST-NOT; return a partial response
1312   using a status code of 200 (OK).
1313</t>
1314<t>
1315   If a cache receives a 5xx response while attempting to revalidate an
1316   entry, it &MAY; either forward this response to the requesting client,
1317   or act as if the server failed to respond. In the latter case, it &MAY;
1318   return a previously received response unless the cached entry
1319   includes the "must-revalidate" cache-control directive (see <xref target="header.cache-control"/>).
1320</t>
1321</section>
1322
1323<section title="Side Effects of GET and HEAD" anchor="side.effects.of.get.and.head">
1324<t>
1325   Unless the origin server explicitly prohibits the caching of their
1326   responses, the application of GET and HEAD methods to any resources
1327   &SHOULD-NOT;  have side effects that would lead to erroneous behavior if
1328   these responses are taken from a cache. They &MAY; still have side
1329   effects, but a cache is not required to consider such side effects in
1330   its caching decisions. Caches are always expected to observe an
1331   origin server's explicit restrictions on caching.
1332</t>
1333<t>
1334   We note one exception to this rule: since some applications have
1335   traditionally used GETs and HEADs with query URLs (those containing a
1336   "?" in the rel_path part) to perform operations with significant side
1337   effects, caches &MUST-NOT; treat responses to such URIs as fresh unless
1338   the server provides an explicit expiration time. This specifically
1339   means that responses from HTTP/1.0 servers for such URIs &SHOULD-NOT;
1340   be taken from a cache. See &safe-methods; for related information.
1341</t>
1342</section>
1343
1344<section title="Invalidation After Updates or Deletions" anchor="invalidation.after.updates.or.deletions">
1345<t>
1346   The effect of certain methods performed on a resource at the origin
1347   server might cause one or more existing cache entries to become non-transparently
1348   invalid. That is, although they might continue to be
1349   "fresh," they do not accurately reflect what the origin server would
1350   return for a new request on that resource.
1351</t>
1352<t>
1353   There is no way for the HTTP protocol to guarantee that all such
1354   cache entries are marked invalid. For example, the request that
1355   caused the change at the origin server might not have gone through
1356   the proxy where a cache entry is stored. However, several rules help
1357   reduce the likelihood of erroneous behavior.
1358</t>
1359<t>
1360   In this section, the phrase "invalidate an entity" means that the
1361   cache will either remove all instances of that entity from its
1362   storage, or will mark these as "invalid" and in need of a mandatory
1363   revalidation before they can be returned in response to a subsequent
1364   request.
1365</t>
1366<t>
1367   Some HTTP methods &MUST; cause a cache to invalidate an entity. This is
1368   either the entity referred to by the Request-URI, or by the Location
1369   or Content-Location headers (if present). These methods are:
1370  <list style="symbols">
1371      <t>PUT</t>
1372      <t>DELETE</t>
1373      <t>POST</t>
1374  </list>
1375</t> 
1376<t>
1377   In order to prevent denial of service attacks, an invalidation based
1378   on the URI in a Location or Content-Location header &MUST; only be
1379   performed if the host part is the same as in the Request-URI.
1380</t>
1381<t>
1382   A cache that passes through requests for methods it does not
1383   understand &SHOULD; invalidate any entities referred to by the
1384   Request-URI.
1385</t>
1386</section>
1387
1388<section title="Write-Through Mandatory" anchor="write-through.mandatory">
1389<t>
1390   All methods that might be expected to cause modifications to the
1391   origin server's resources &MUST; be written through to the origin
1392   server. This currently includes all methods except for GET and HEAD.
1393   A cache &MUST-NOT; reply to such a request from a client before having
1394   transmitted the request to the inbound server, and having received a
1395   corresponding response from the inbound server. This does not prevent
1396   a proxy cache from sending a 100 (Continue) response before the
1397   inbound server has sent its final reply.
1398</t>
1399<t>
1400   The alternative (known as "write-back" or "copy-back" caching) is not
1401   allowed in HTTP/1.1, due to the difficulty of providing consistent
1402   updates and the problems arising from server, cache, or network
1403   failure prior to write-back.
1404</t>
1405</section>
1406
1407<section title="Cache Replacement" anchor="cache.replacement">
1408<t>
1409   If a new cacheable (see sections <xref target="what.may.be.stored.by.caches" format="counter"/>,
1410   <xref target="disambiguating.expiration.values" format="counter"/>,
1411   <xref target="disambiguating.multiple.responses" format="counter"/>
1412   and <xref target="errors.or.incomplete.response.cache.behavior" format="counter"/>)
1413   response is received from a resource while any existing responses for
1414   the same resource are cached, the cache &SHOULD; use the new response
1415   to reply to the current request. It &MAY; insert it into cache storage
1416   and &MAY;, if it meets all other requirements, use it to respond to any
1417   future requests that would previously have caused the old response to
1418   be returned. If it inserts the new response into cache storage  the
1419   rules in <xref target="combining.headers"/> apply.
1420  <list><t>
1421      <x:h>Note:</x:h> a new response that has an older Date header value than
1422      existing cached responses is not cacheable.
1423  </t></list>
1424</t>
1425</section>
1426
1427<section title="History Lists" anchor="history.lists">
1428<t>
1429   User agents often have history mechanisms, such as "Back" buttons and
1430   history lists, which can be used to redisplay an entity retrieved
1431   earlier in a session.
1432</t>
1433<t>
1434   History mechanisms and caches are different. In particular history
1435   mechanisms &SHOULD-NOT;  try to show a semantically transparent view of
1436   the current state of a resource. Rather, a history mechanism is meant
1437   to show exactly what the user saw at the time when the resource was
1438   retrieved.
1439</t>
1440<t>
1441   By default, an expiration time does not apply to history mechanisms.
1442   If the entity is still in storage, a history mechanism &SHOULD; display
1443   it even if the entity has expired, unless the user has specifically
1444   configured the agent to refresh expired history documents.
1445</t>
1446<t>
1447   This is not to be construed to prohibit the history mechanism from
1448   telling the user that a view might be stale.
1449  <list><t>
1450      <x:h>Note:</x:h> if history list mechanisms unnecessarily prevent users from
1451      viewing stale resources, this will tend to force service authors
1452      to avoid using HTTP expiration controls and cache controls when
1453      they would otherwise like to. Service authors may consider it
1454      important that users not be presented with error messages or
1455      warning messages when they use navigation controls (such as BACK)
1456      to view previously fetched resources. Even though sometimes such
1457      resources ought not to cached, or ought to expire quickly, user
1458      interface considerations may force service authors to resort to
1459      other means of preventing caching (e.g. "once-only" URLs) in order
1460      not to suffer the effects of improperly functioning history
1461      mechanisms.
1462  </t></list>
1463</t>
1464</section>
1465</section>
1466
1467<section title="Header Field Definitions" anchor="header.fields">
1468<t>
1469   This section defines the syntax and semantics of all standard
1470   HTTP/1.1 header fields. For entity-header fields, both sender and
1471   recipient refer to either the client or the server, depending on who
1472   sends and who receives the entity.
1473</t>
1474
1475<section title="Age" anchor="header.age">
1476  <iref primary="true" item="Age header" x:for-anchor=""/>
1477  <iref primary="true" item="Headers" subitem="Age" x:for-anchor=""/>
1478<t>
1479      The Age response-header field conveys the sender's estimate of the
1480      amount of time since the response (or its revalidation) was
1481      generated at the origin server. A cached response is "fresh" if
1482      its age does not exceed its freshness lifetime. Age values are
1483      calculated as specified in <xref target="age.calculations"/>.
1484</t>
1485<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Age"/><iref primary="true" item="Grammar" subitem="age-value"/>
1486        Age = "Age" ":" age-value
1487        age-value = delta-seconds
1488</artwork></figure>
1489<t>
1490      Age values are non-negative decimal integers, representing time in
1491      seconds.
1492</t>
1493<t>
1494      If a cache receives a value larger than the largest positive
1495      integer it can represent, or if any of its age calculations
1496      overflows, it &MUST; transmit an Age header with a value of
1497      2147483648 (2^31). An HTTP/1.1 server that includes a cache &MUST;
1498      include an Age header field in every response generated from its
1499      own cache. Caches &SHOULD; use an arithmetic type of at least 31
1500      bits of range.
1501</t>
1502</section>
1503
1504<section title="Cache-Control" anchor="header.cache-control">
1505  <iref primary="true" item="Cache-Control header" x:for-anchor=""/>
1506  <iref primary="true" item="Headers" subitem="Cache-Control" x:for-anchor=""/>
1507<t>
1508   The Cache-Control general-header field is used to specify directives
1509   that &MUST; be obeyed by all caching mechanisms along the
1510   request/response chain. The directives specify behavior intended to
1511   prevent caches from adversely interfering with the request or
1512   response. These directives typically override the default caching
1513   algorithms. Cache directives are unidirectional in that the presence
1514   of a directive in a request does not imply that the same directive is
1515   to be given in the response.
1516  <list><t>
1517      Note that HTTP/1.0 caches might not implement Cache-Control and
1518      might only implement Pragma: no-cache (see <xref target="header.pragma"/>).
1519  </t></list>
1520</t>
1521<t>
1522   Cache directives &MUST; be passed through by a proxy or gateway
1523   application, regardless of their significance to that application,
1524   since the directives might be applicable to all recipients along the
1525   request/response chain. It is not possible to specify a cache-directive
1526   for a specific cache.
1527</t>
1528<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Cache-Control"/><iref primary="true" item="Grammar" subitem="cache-directive"/><iref primary="true" item="Grammar" subitem="cache-request-directive"/><iref primary="true" item="Grammar" subitem="cache-response-directive"/><iref primary="true" item="Grammar" subitem="cache-extension"/>
1529   Cache-Control   = "Cache-Control" ":" 1#cache-directive
1530
1531   cache-directive = cache-request-directive
1532        | cache-response-directive
1533
1534   cache-request-directive =
1535          "no-cache"                          ; <xref target="what.is.cacheable"/>
1536        | "no-store"                          ; <xref target="what.may.be.stored.by.caches"/>
1537        | "max-age" "=" delta-seconds         ; <xref target="modifications.of.the.basic.expiration.mechanism"/>, <xref format="counter" target="cache.revalidation.and.reload.controls"/>
1538        | "max-stale" [ "=" delta-seconds ]   ; <xref target="modifications.of.the.basic.expiration.mechanism"/>
1539        | "min-fresh" "=" delta-seconds       ; <xref target="modifications.of.the.basic.expiration.mechanism"/>
1540        | "no-transform"                      ; <xref target="no-transform.directive"/>
1541        | "only-if-cached"                    ; <xref target="cache.revalidation.and.reload.controls"/>
1542        | cache-extension                     ; <xref target="cache.control.extensions"/>
1543
1544    cache-response-directive =
1545          "public"                               ; <xref target="what.is.cacheable"/>
1546        | "private" [ "=" &lt;"&gt; 1#field-name &lt;"&gt; ] ; <xref target="what.is.cacheable"/>
1547        | "no-cache" [ "=" &lt;"&gt; 1#field-name &lt;"&gt; ]; <xref target="what.is.cacheable"/>
1548        | "no-store"                             ; <xref target="what.may.be.stored.by.caches"/>
1549        | "no-transform"                         ; <xref target="no-transform.directive"/>
1550        | "must-revalidate"                      ; <xref target="cache.revalidation.and.reload.controls"/>
1551        | "proxy-revalidate"                     ; <xref target="cache.revalidation.and.reload.controls"/>
1552        | "max-age" "=" delta-seconds            ; <xref target="modifications.of.the.basic.expiration.mechanism"/>
1553        | "s-maxage" "=" delta-seconds           ; <xref target="modifications.of.the.basic.expiration.mechanism"/>
1554        | cache-extension                        ; <xref target="cache.control.extensions"/>
1555
1556   cache-extension = token [ "=" ( token | quoted-string ) ]
1557</artwork></figure>
1558<t>
1559   When a directive appears without any 1#field-name parameter, the
1560   directive applies to the entire request or response. When such a
1561   directive appears with a 1#field-name parameter, it applies only to
1562   the named field or fields, and not to the rest of the request or
1563   response. This mechanism supports extensibility; implementations of
1564   future versions of the HTTP protocol might apply these directives to
1565   header fields not defined in HTTP/1.1.
1566</t>
1567<t>
1568   The cache-control directives can be broken down into these general
1569   categories:
1570  <list style="symbols">
1571     <t>Restrictions on what are cacheable; these may only be imposed by
1572        the origin server.</t>
1573
1574     <t>Restrictions on what may be stored by a cache; these may be
1575        imposed by either the origin server or the user agent.</t>
1576
1577     <t>Modifications of the basic expiration mechanism; these may be
1578        imposed by either the origin server or the user agent.</t>
1579
1580     <t>Controls over cache revalidation and reload; these may only be
1581        imposed by a user agent.</t>
1582
1583     <t>Control over transformation of entities.</t>
1584
1585     <t>Extensions to the caching system.</t>
1586  </list>
1587</t>
1588
1589<section title="What is Cacheable" anchor="what.is.cacheable">
1590<t>
1591   By default, a response is cacheable if the requirements of the
1592   request method, request header fields, and the response status
1593   indicate that it is cacheable. <xref target="response.cacheability"/> summarizes these defaults
1594   for cacheability. The following Cache-Control response directives
1595   allow an origin server to override the default cacheability of a
1596   response:
1597</t>
1598<t>
1599  <iref item="Cache Directives" subitem="public" primary="true"/>
1600  <iref item="public" subitem="Cache Directive" primary="true"/>
1601   public
1602  <list><t>
1603      Indicates that the response &MAY; be cached by any cache, even if it
1604      would normally be non-cacheable or cacheable only within a non-shared
1605      cache. (See also Authorization, &header-authorization;, for
1606      additional details.)
1607  </t></list>
1608</t>
1609<t>
1610  <iref item="Cache Directives" subitem="private" primary="true"/>
1611  <iref item="private" subitem="Cache Directive" primary="true"/>
1612   private
1613  <list><t>
1614      Indicates that all or part of the response message is intended for
1615      a single user and &MUST-NOT; be cached by a shared cache. This
1616      allows an origin server to state that the specified parts of the
1617      response are intended for only one user and are not a valid
1618      response for requests by other users. A private (non-shared) cache
1619      &MAY; cache the response.
1620    </t><t>
1621       <x:h>Note:</x:h> This usage of the word private only controls where the
1622       response may be cached, and cannot ensure the privacy of the
1623       message content.
1624  </t></list>
1625</t>
1626<t>
1627  <iref item="Cache Directives" subitem="no-cache" primary="true"/>
1628  <iref item="no-cache" subitem="Cache Directive" primary="true"/>
1629   no-cache
1630  <list><t>
1631       If the no-cache directive does not specify a field-name, then a
1632      cache &MUST-NOT; use the response to satisfy a subsequent request
1633      without successful revalidation with the origin server. This
1634      allows an origin server to prevent caching even by caches that
1635      have been configured to return stale responses to client requests.
1636    </t><t>
1637      If the no-cache directive does specify one or more field-names,
1638      then a cache &MAY; use the response to satisfy a subsequent request,
1639      subject to any other restrictions on caching. However, the
1640      specified field-name(s) &MUST-NOT; be sent in the response to a
1641      subsequent request without successful revalidation with the origin
1642      server. This allows an origin server to prevent the re-use of
1643      certain header fields in a response, while still allowing caching
1644      of the rest of the response.
1645    <list><t>
1646       <x:h>Note:</x:h> Most HTTP/1.0 caches will not recognize or obey this
1647       directive.
1648    </t></list>
1649  </t></list>
1650</t>
1651</section>
1652
1653<section title="What May be Stored by Caches" anchor="what.may.be.stored.by.caches">
1654<t>
1655  <iref item="Cache Directives" subitem="no-store" primary="true"/>
1656  <iref item="no-store" subitem="Cache Directive" primary="true"/>
1657   no-store
1658  <list><t>   
1659      The purpose of the no-store directive is to prevent the
1660      inadvertent release or retention of sensitive information (for
1661      example, on backup tapes). The no-store directive applies to the
1662      entire message, and &MAY; be sent either in a response or in a
1663      request. If sent in a request, a cache &MUST-NOT; store any part of
1664      either this request or any response to it. If sent in a response,
1665      a cache &MUST-NOT; store any part of either this response or the
1666      request that elicited it. This directive applies to both non-shared
1667      and shared caches. "&MUST-NOT; store" in this context means
1668      that the cache &MUST-NOT; intentionally store the information in
1669      non-volatile storage, and &MUST; make a best-effort attempt to
1670      remove the information from volatile storage as promptly as
1671      possible after forwarding it.
1672  </t><t>
1673      Even when this directive is associated with a response, users
1674      might explicitly store such a response outside of the caching
1675      system (e.g., with a "Save As" dialog). History buffers &MAY; store
1676      such responses as part of their normal operation.
1677  </t><t>
1678      The purpose of this directive is to meet the stated requirements
1679      of certain users and service authors who are concerned about
1680      accidental releases of information via unanticipated accesses to
1681      cache data structures. While the use of this directive might
1682      improve privacy in some cases, we caution that it is NOT in any
1683      way a reliable or sufficient mechanism for ensuring privacy. In
1684      particular, malicious or compromised caches might not recognize or
1685      obey this directive, and communications networks might be
1686      vulnerable to eavesdropping.
1687  </t></list>
1688</t>
1689</section>
1690
1691<section title="Modifications of the Basic Expiration Mechanism" anchor="modifications.of.the.basic.expiration.mechanism">
1692<t>
1693   The expiration time of an entity &MAY; be specified by the origin
1694   server using the Expires header (see <xref target="header.expires"/>). Alternatively,
1695   it &MAY; be specified using the max-age directive in a response. When
1696   the max-age cache-control directive is present in a cached response,
1697   the response is stale if its current age is greater than the age
1698   value given (in seconds) at the time of a new request for that
1699   resource. The max-age directive on a response implies that the
1700   response is cacheable (i.e., "public") unless some other, more
1701   restrictive cache directive is also present.
1702</t>
1703<t>
1704   If a response includes both an Expires header and a max-age
1705   directive, the max-age directive overrides the Expires header, even
1706   if the Expires header is more restrictive. This rule allows an origin
1707   server to provide, for a given response, a longer expiration time to
1708   an HTTP/1.1 (or later) cache than to an HTTP/1.0 cache. This might be
1709   useful if certain HTTP/1.0 caches improperly calculate ages or
1710   expiration times, perhaps due to desynchronized clocks.
1711</t>
1712<t>
1713   Many HTTP/1.0 cache implementations will treat an Expires value that
1714   is less than or equal to the response Date value as being equivalent
1715   to the Cache-Control response directive "no-cache". If an HTTP/1.1
1716   cache receives such a response, and the response does not include a
1717   Cache-Control header field, it &SHOULD; consider the response to be
1718   non-cacheable in order to retain compatibility with HTTP/1.0 servers.
1719  <list><t>
1720       <x:h>Note:</x:h> An origin server might wish to use a relatively new HTTP
1721       cache control feature, such as the "private" directive, on a
1722       network including older caches that do not understand that
1723       feature. The origin server will need to combine the new feature
1724       with an Expires field whose value is less than or equal to the
1725       Date value. This will prevent older caches from improperly
1726       caching the response.
1727  </t></list>
1728</t>
1729<t>
1730  <iref item="Cache Directives" subitem="s-maxage" primary="true"/>
1731  <iref item="s-maxage" subitem="Cache Directive" primary="true"/>
1732   s-maxage
1733  <list><t>
1734       If a response includes an s-maxage directive, then for a shared
1735       cache (but not for a private cache), the maximum age specified by
1736       this directive overrides the maximum age specified by either the
1737       max-age directive or the Expires header. The s-maxage directive
1738       also implies the semantics of the proxy-revalidate directive (see
1739       <xref target="cache.revalidation.and.reload.controls"/>), i.e., that the shared cache must not use the
1740       entry after it becomes stale to respond to a subsequent request
1741       without first revalidating it with the origin server. The s-maxage
1742       directive is always ignored by a private cache.
1743  </t></list>
1744</t>
1745<t>
1746   Note that most older caches, not compliant with this specification,
1747   do not implement any cache-control directives. An origin server
1748   wishing to use a cache-control directive that restricts, but does not
1749   prevent, caching by an HTTP/1.1-compliant cache &MAY; exploit the
1750   requirement that the max-age directive overrides the Expires header,
1751   and the fact that pre-HTTP/1.1-compliant caches do not observe the
1752   max-age directive.
1753</t>
1754<t>
1755   Other directives allow a user agent to modify the basic expiration
1756   mechanism. These directives &MAY; be specified on a request:
1757</t>
1758<t>
1759  <iref item="Cache Directives" subitem="max-age" primary="true"/>
1760  <iref item="max-age" subitem="Cache Directive" primary="true"/>
1761   max-age
1762  <list><t>
1763      Indicates that the client is willing to accept a response whose
1764      age is no greater than the specified time in seconds. Unless max-stale
1765      directive is also included, the client is not willing to
1766      accept a stale response.
1767  </t></list>
1768</t>
1769<t>
1770  <iref item="Cache Directives" subitem="min-fresh" primary="true"/>
1771  <iref item="min-fresh" subitem="Cache Directive" primary="true"/>
1772   min-fresh
1773  <list><t>
1774      Indicates that the client is willing to accept a response whose
1775      freshness lifetime is no less than its current age plus the
1776      specified time in seconds. That is, the client wants a response
1777      that will still be fresh for at least the specified number of
1778      seconds.
1779  </t></list>
1780</t>
1781<t>
1782  <iref item="Cache Directives" subitem="max-stale" primary="true"/>
1783  <iref item="max-stale" subitem="Cache Directive" primary="true"/>
1784   max-stale
1785  <list><t>
1786      Indicates that the client is willing to accept a response that has
1787      exceeded its expiration time. If max-stale is assigned a value,
1788      then the client is willing to accept a response that has exceeded
1789      its expiration time by no more than the specified number of
1790      seconds. If no value is assigned to max-stale, then the client is
1791      willing to accept a stale response of any age.
1792  </t></list>
1793</t>
1794<t>
1795   If a cache returns a stale response, either because of a max-stale
1796   directive on a request, or because the cache is configured to
1797   override the expiration time of a response, the cache &MUST; attach a
1798   Warning header to the stale response, using Warning 110 (Response is
1799   stale).
1800</t>
1801<t>
1802   A cache &MAY; be configured to return stale responses without
1803   validation, but only if this does not conflict with any "MUST"-level
1804   requirements concerning cache validation (e.g., a "must-revalidate"
1805   cache-control directive).
1806</t>
1807<t>
1808   If both the new request and the cached entry include "max-age"
1809   directives, then the lesser of the two values is used for determining
1810   the freshness of the cached entry for that request.
1811</t>
1812</section>
1813
1814<section title="Cache Revalidation and Reload Controls" anchor="cache.revalidation.and.reload.controls">
1815<t>
1816   Sometimes a user agent might want or need to insist that a cache
1817   revalidate its cache entry with the origin server (and not just with
1818   the next cache along the path to the origin server), or to reload its
1819   cache entry from the origin server. End-to-end revalidation might be
1820   necessary if either the cache or the origin server has overestimated
1821   the expiration time of the cached response. End-to-end reload may be
1822   necessary if the cache entry has become corrupted for some reason.
1823</t>
1824<t>
1825   End-to-end revalidation may be requested either when the client does
1826   not have its own local cached copy, in which case we call it
1827   "unspecified end-to-end revalidation", or when the client does have a
1828   local cached copy, in which case we call it "specific end-to-end
1829   revalidation."
1830</t>
1831<t>
1832   The client can specify these three kinds of action using Cache-Control
1833   request directives:
1834</t>
1835<t>
1836   End-to-end reload
1837  <list><t>
1838      The request includes a "no-cache" cache-control directive or, for
1839      compatibility with HTTP/1.0 clients, "Pragma: no-cache". Field
1840      names &MUST-NOT; be included with the no-cache directive in a
1841      request. The server &MUST-NOT; use a cached copy when responding to
1842      such a request.
1843  </t></list>
1844</t>
1845<t>
1846   Specific end-to-end revalidation
1847  <list><t>
1848      The request includes a "max-age=0" cache-control directive, which
1849      forces each cache along the path to the origin server to
1850      revalidate its own entry, if any, with the next cache or server.
1851      The initial request includes a cache-validating conditional with
1852      the client's current validator.
1853  </t></list>
1854</t>
1855<t>
1856   Unspecified end-to-end revalidation
1857  <list><t>
1858      The request includes "max-age=0" cache-control directive, which
1859      forces each cache along the path to the origin server to
1860      revalidate its own entry, if any, with the next cache or server.
1861      The initial request does not include a cache-validating
1862      conditional; the first cache along the path (if any) that holds a
1863      cache entry for this resource includes a cache-validating
1864      conditional with its current validator.
1865  </t></list>
1866</t>
1867<t>
1868  <iref item="Cache Directives" subitem="max-age" primary="true"/>
1869  <iref item="max-age" subitem="Cache Directive" primary="true"/>
1870   max-age
1871  <list><t>
1872      When an intermediate cache is forced, by means of a max-age=0
1873      directive, to revalidate its own cache entry, and the client has
1874      supplied its own validator in the request, the supplied validator
1875      might differ from the validator currently stored with the cache
1876      entry. In this case, the cache &MAY; use either validator in making
1877      its own request without affecting semantic transparency.
1878  </t><t>
1879      However, the choice of validator might affect performance. The
1880      best approach is for the intermediate cache to use its own
1881      validator when making its request. If the server replies with 304
1882      (Not Modified), then the cache can return its now validated copy
1883      to the client with a 200 (OK) response. If the server replies with
1884      a new entity and cache validator, however, the intermediate cache
1885      can compare the returned validator with the one provided in the
1886      client's request, using the strong comparison function. If the
1887      client's validator is equal to the origin server's, then the
1888      intermediate cache simply returns 304 (Not Modified). Otherwise,
1889      it returns the new entity with a 200 (OK) response.
1890  </t><t>
1891      If a request includes the no-cache directive, it &SHOULD-NOT;
1892      include min-fresh, max-stale, or max-age.
1893  </t></list>
1894</t>
1895<t>
1896  <iref item="Cache Directives" subitem="only-if-cached" primary="true"/>
1897  <iref item="only-if-cached" subitem="Cache Directive" primary="true"/>
1898   only-if-cached
1899  <list><t>
1900      In some cases, such as times of extremely poor network
1901      connectivity, a client may want a cache to return only those
1902      responses that it currently has stored, and not to reload or
1903      revalidate with the origin server. To do this, the client may
1904      include the only-if-cached directive in a request. If it receives
1905      this directive, a cache &SHOULD; either respond using a cached entry
1906      that is consistent with the other constraints of the request, or
1907      respond with a 504 (Gateway Timeout) status. However, if a group
1908      of caches is being operated as a unified system with good internal
1909      connectivity, such a request &MAY; be forwarded within that group of
1910      caches.
1911  </t></list>
1912</t>
1913<t>
1914  <iref item="Cache Directives" subitem="must-revalidate" primary="true"/>
1915  <iref item="must-revalidate" subitem="Cache Directive" primary="true"/>
1916   must-revalidate
1917  <list><t>
1918      Because a cache &MAY; be configured to ignore a server's specified
1919      expiration time, and because a client request &MAY; include a max-stale
1920      directive (which has a similar effect), the protocol also
1921      includes a mechanism for the origin server to require revalidation
1922      of a cache entry on any subsequent use. When the must-revalidate
1923      directive is present in a response received by a cache, that cache
1924      &MUST-NOT; use the entry after it becomes stale to respond to a
1925      subsequent request without first revalidating it with the origin
1926      server. (I.e., the cache &MUST; do an end-to-end revalidation every
1927      time, if, based solely on the origin server's Expires or max-age
1928      value, the cached response is stale.)
1929  </t><t>
1930      The must-revalidate directive is necessary to support reliable
1931      operation for certain protocol features. In all circumstances an
1932      HTTP/1.1 cache &MUST; obey the must-revalidate directive; in
1933      particular, if the cache cannot reach the origin server for any
1934      reason, it &MUST; generate a 504 (Gateway Timeout) response.
1935  </t><t>
1936      Servers &SHOULD; send the must-revalidate directive if and only if
1937      failure to revalidate a request on the entity could result in
1938      incorrect operation, such as a silently unexecuted financial
1939      transaction. Recipients &MUST-NOT; take any automated action that
1940      violates this directive, and &MUST-NOT; automatically provide an
1941      unvalidated copy of the entity if revalidation fails.
1942  </t><t>
1943      Although this is not recommended, user agents operating under
1944      severe connectivity constraints &MAY; violate this directive but, if
1945      so, &MUST; explicitly warn the user that an unvalidated response has
1946      been provided. The warning &MUST; be provided on each unvalidated
1947      access, and &SHOULD; require explicit user confirmation.
1948  </t></list>
1949</t>
1950<t>
1951  <iref item="Cache Directives" subitem="proxy-revalidate" primary="true"/>
1952  <iref item="proxy-revalidate" subitem="Cache Directive" primary="true"/>
1953   proxy-revalidate
1954  <list><t>
1955      The proxy-revalidate directive has the same meaning as the must-revalidate
1956      directive, except that it does not apply to non-shared
1957      user agent caches. It can be used on a response to an
1958      authenticated request to permit the user's cache to store and
1959      later return the response without needing to revalidate it (since
1960      it has already been authenticated once by that user), while still
1961      requiring proxies that service many users to revalidate each time
1962      (in order to make sure that each user has been authenticated).
1963      Note that such authenticated responses also need the public cache
1964      control directive in order to allow them to be cached at all.
1965  </t></list>
1966</t>
1967</section>
1968
1969<section title="No-Transform Directive" anchor="no-transform.directive">
1970<t>
1971  <iref item="Cache Directives" subitem="no-transform" primary="true"/>
1972  <iref item="no-transform" subitem="Cache Directive" primary="true"/>
1973   no-transform
1974  <list><t>
1975      Implementors of intermediate caches (proxies) have found it useful
1976      to convert the media type of certain entity bodies. A non-transparent
1977      proxy might, for example, convert between image
1978      formats in order to save cache space or to reduce the amount of
1979      traffic on a slow link.
1980  </t><t>
1981      Serious operational problems occur, however, when these
1982      transformations are applied to entity bodies intended for certain
1983      kinds of applications. For example, applications for medical
1984      imaging, scientific data analysis and those using end-to-end
1985      authentication, all depend on receiving an entity body that is bit
1986      for bit identical to the original entity-body.
1987  </t><t>
1988      Therefore, if a message includes the no-transform directive, an
1989      intermediate cache or proxy &MUST-NOT; change those headers that are
1990      listed in <xref target="non-modifiable.headers"/> as being subject to the no-transform
1991      directive. This implies that the cache or proxy &MUST-NOT; change
1992      any aspect of the entity-body that is specified by these headers,
1993      including the value of the entity-body itself.
1994  </t></list>
1995</t>
1996</section>
1997
1998<section title="Cache Control Extensions" anchor="cache.control.extensions">
1999<t>
2000   The Cache-Control header field can be extended through the use of one
2001   or more cache-extension tokens, each with an optional assigned value.
2002   Informational extensions (those which do not require a change in
2003   cache behavior) &MAY; be added without changing the semantics of other
2004   directives. Behavioral extensions are designed to work by acting as
2005   modifiers to the existing base of cache directives. Both the new
2006   directive and the standard directive are supplied, such that
2007   applications which do not understand the new directive will default
2008   to the behavior specified by the standard directive, and those that
2009   understand the new directive will recognize it as modifying the
2010   requirements associated with the standard directive. In this way,
2011   extensions to the cache-control directives can be made without
2012   requiring changes to the base protocol.
2013</t>
2014<t>
2015   This extension mechanism depends on an HTTP cache obeying all of the
2016   cache-control directives defined for its native HTTP-version, obeying
2017   certain extensions, and ignoring all directives that it does not
2018   understand.
2019</t>
2020<t>
2021   For example, consider a hypothetical new response directive called
2022   community which acts as a modifier to the private directive. We
2023   define this new directive to mean that, in addition to any non-shared
2024   cache, any cache which is shared only by members of the community
2025   named within its value may cache the response. An origin server
2026   wishing to allow the UCI community to use an otherwise private
2027   response in their shared cache(s) could do so by including
2028</t>
2029<figure><artwork type="example">
2030    Cache-Control: private, community="UCI"
2031</artwork></figure>
2032<t>
2033   A cache seeing this header field will act correctly even if the cache
2034   does not understand the community cache-extension, since it will also
2035   see and understand the private directive and thus default to the safe
2036   behavior.
2037</t>
2038<t>
2039   Unrecognized cache-directives &MUST; be ignored; it is assumed that any
2040   cache-directive likely to be unrecognized by an HTTP/1.1 cache will
2041   be combined with standard directives (or the response's default
2042   cacheability) such that the cache behavior will remain minimally
2043   correct even if the cache does not understand the extension(s).
2044</t>
2045</section>
2046</section>
2047
2048<section title="Expires" anchor="header.expires">
2049  <iref primary="true" item="Expires header" x:for-anchor=""/>
2050  <iref primary="true" item="Headers" subitem="Expires" x:for-anchor=""/>
2051<t>
2052   The Expires entity-header field gives the date/time after which the
2053   response is considered stale. A stale cache entry may not normally be
2054   returned by a cache (either a proxy cache or a user agent cache)
2055   unless it is first validated with the origin server (or with an
2056   intermediate cache that has a fresh copy of the entity). See <xref target="expiration.model"/>
2057   for further discussion of the expiration model.
2058</t>
2059<t>
2060   The presence of an Expires field does not imply that the original
2061   resource will change or cease to exist at, before, or after that
2062   time.
2063</t>
2064<t>
2065   The format is an absolute date and time as defined by HTTP-date in
2066   &full-date;; it &MUST; be in RFC 1123 date format:
2067</t>
2068<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Expires"/>
2069   Expires = "Expires" ":" HTTP-date
2070</artwork></figure>
2071<t>
2072   An example of its use is
2073</t>
2074<figure><artwork type="example">
2075   Expires: Thu, 01 Dec 1994 16:00:00 GMT
2076</artwork></figure>
2077<t>
2078  <list><t>
2079      <x:h>Note:</x:h> if a response includes a Cache-Control field with the max-age
2080      directive (see <xref target="modifications.of.the.basic.expiration.mechanism"/>), that directive overrides the
2081      Expires field.
2082  </t></list>
2083</t>
2084<t>
2085   HTTP/1.1 clients and caches &MUST; treat other invalid date formats,
2086   especially including the value "0", as in the past (i.e., "already
2087   expired").
2088</t>
2089<t>
2090   To mark a response as "already expired," an origin server sends an
2091   Expires date that is equal to the Date header value. (See the rules
2092   for expiration calculations in <xref target="expiration.calculations"/>.)
2093</t>
2094<t>
2095   To mark a response as "never expires," an origin server sends an
2096   Expires date approximately one year from the time the response is
2097   sent. HTTP/1.1 servers &SHOULD-NOT;  send Expires dates more than one
2098   year in the future.
2099</t>
2100<t>
2101   The presence of an Expires header field with a date value of some
2102   time in the future on a response that otherwise would by default be
2103   non-cacheable indicates that the response is cacheable, unless
2104   indicated otherwise by a Cache-Control header field (<xref target="header.cache-control"/>).
2105</t>
2106</section>
2107
2108<section title="Pragma" anchor="header.pragma">
2109  <iref primary="true" item="Pragma header" x:for-anchor=""/>
2110  <iref primary="true" item="Headers" subitem="Pragma" x:for-anchor=""/>
2111<t>
2112   The Pragma general-header field is used to include implementation-specific
2113   directives that might apply to any recipient along the
2114   request/response chain. All pragma directives specify optional
2115   behavior from the viewpoint of the protocol; however, some systems
2116   &MAY; require that behavior be consistent with the directives.
2117</t>
2118<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Pragma"/><iref primary="true" item="Grammar" subitem="pragma-directive"/><iref primary="true" item="Grammar" subitem="extension-pragma"/>
2119    Pragma            = "Pragma" ":" 1#pragma-directive
2120    pragma-directive  = "no-cache" | extension-pragma
2121    extension-pragma  = token [ "=" ( token | quoted-string ) ]
2122</artwork></figure>
2123<t>
2124   When the no-cache directive is present in a request message, an
2125   application &SHOULD; forward the request toward the origin server even
2126   if it has a cached copy of what is being requested. This pragma
2127   directive has the same semantics as the no-cache cache-directive (see
2128   <xref target="header.cache-control"/>) and is defined here for backward compatibility with
2129   HTTP/1.0. Clients &SHOULD; include both header fields when a no-cache
2130   request is sent to a server not known to be HTTP/1.1 compliant.
2131</t>
2132<t>
2133   Pragma directives &MUST; be passed through by a proxy or gateway
2134   application, regardless of their significance to that application,
2135   since the directives might be applicable to all recipients along the
2136   request/response chain. It is not possible to specify a pragma for a
2137   specific recipient; however, any pragma directive not relevant to a
2138   recipient &SHOULD; be ignored by that recipient.
2139</t>
2140<t>
2141   HTTP/1.1 caches &SHOULD; treat "Pragma: no-cache" as if the client had
2142   sent "Cache-Control: no-cache". No new Pragma directives will be
2143   defined in HTTP.
2144  <list><t>
2145      <x:h>Note:</x:h> because the meaning of "Pragma: no-cache as a response
2146      header field is not actually specified, it does not provide a
2147      reliable replacement for "Cache-Control: no-cache" in a response
2148  </t></list>
2149</t>
2150</section>
2151
2152<section title="Vary" anchor="header.vary">
2153  <iref primary="true" item="Vary header" x:for-anchor=""/>
2154  <iref primary="true" item="Headers" subitem="Vary" x:for-anchor=""/>
2155<t>
2156   The Vary field value indicates the set of request-header fields that
2157   fully determines, while the response is fresh, whether a cache is
2158   permitted to use the response to reply to a subsequent request
2159   without revalidation. For uncacheable or stale responses, the Vary
2160   field value advises the user agent about the criteria that were used
2161   to select the representation. A Vary field value of "*" implies that
2162   a cache cannot determine from the request headers of a subsequent
2163   request whether this response is the appropriate representation. See
2164   <xref target="caching.negotiated.responses"/> for use of the Vary header field by caches.
2165</t>
2166<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Vary"/>
2167    Vary  = "Vary" ":" ( "*" | 1#field-name )
2168</artwork></figure>
2169<t>
2170   An HTTP/1.1 server &SHOULD; include a Vary header field with any
2171   cacheable response that is subject to server-driven negotiation.
2172   Doing so allows a cache to properly interpret future requests on that
2173   resource and informs the user agent about the presence of negotiation
2174   on that resource. A server &MAY; include a Vary header field with a
2175   non-cacheable response that is subject to server-driven negotiation,
2176   since this might provide the user agent with useful information about
2177   the dimensions over which the response varies at the time of the
2178   response.
2179</t>
2180<t>
2181   A Vary field value consisting of a list of field-names signals that
2182   the representation selected for the response is based on a selection
2183   algorithm which considers ONLY the listed request-header field values
2184   in selecting the most appropriate representation. A cache &MAY; assume
2185   that the same selection will be made for future requests with the
2186   same values for the listed field names, for the duration of time for
2187   which the response is fresh.
2188</t>
2189<t>
2190   The field-names given are not limited to the set of standard
2191   request-header fields defined by this specification. Field names are
2192   case-insensitive.
2193</t>
2194<t>
2195   A Vary field value of "*" signals that unspecified parameters not
2196   limited to the request-headers (e.g., the network address of the
2197   client), play a role in the selection of the response representation.
2198   The "*" value &MUST-NOT; be generated by a proxy server; it may only be
2199   generated by an origin server.
2200</t>
2201</section>
2202
2203<section title="Warning" anchor="header.warning">
2204  <iref primary="true" item="Warning header" x:for-anchor=""/>
2205  <iref primary="true" item="Headers" subitem="Warning" x:for-anchor=""/>
2206<t>
2207   The Warning general-header field is used to carry additional
2208   information about the status or transformation of a message which
2209   might not be reflected in the message. This information is typically
2210   used to warn about a possible lack of semantic transparency from
2211   caching operations or transformations applied to the entity body of
2212   the message.
2213</t>
2214<t>
2215   Warning headers are sent with responses using:
2216</t>
2217<figure><artwork type="abnf2616"><iref primary="true" item="Grammar" subitem="Warning"/><iref primary="true" item="Grammar" subitem="warning-value"/><iref primary="true" item="Grammar" subitem="warn-code"/><iref primary="true" item="Grammar" subitem="warn-agent"/><iref primary="true" item="Grammar" subitem="warn-text"/><iref primary="true" item="Grammar" subitem="warn-date"/>
2218    Warning    = "Warning" ":" 1#warning-value
2219
2220    warning-value = warn-code SP warn-agent SP warn-text
2221                                          [SP warn-date]
2222
2223    warn-code  = 3DIGIT
2224    warn-agent = ( host [ ":" port ] ) | pseudonym
2225                    ; the name or pseudonym of the server adding
2226                    ; the Warning header, for use in debugging
2227    warn-text  = quoted-string
2228    warn-date  = &lt;"&gt; HTTP-date &lt;"&gt;
2229</artwork></figure>
2230<t>
2231   A response &MAY; carry more than one Warning header.
2232</t>
2233<t>
2234   The warn-text &SHOULD; be in a natural language and character set that
2235   is most likely to be intelligible to the human user receiving the
2236   response. This decision &MAY; be based on any available knowledge, such
2237   as the location of the cache or user, the Accept-Language field in a
2238   request, the Content-Language field in a response, etc. The default
2239   language is English and the default character set is ISO-8859-1.
2240</t>
2241<t>
2242   If a character set other than ISO-8859-1 is used, it &MUST; be encoded
2243   in the warn-text using the method described in RFC 2047 <xref target="RFC2047"/>.
2244</t>
2245<t>
2246   Warning headers can in general be applied to any message, however
2247   some specific warn-codes are specific to caches and can only be
2248   applied to response messages. New Warning headers &SHOULD; be added
2249   after any existing Warning headers. A cache &MUST-NOT; delete any
2250   Warning header that it received with a message. However, if a cache
2251   successfully validates a cache entry, it &SHOULD; remove any Warning
2252   headers previously attached to that entry except as specified for
2253   specific Warning codes. It &MUST; then add any Warning headers received
2254   in the validating response. In other words, Warning headers are those
2255   that would be attached to the most recent relevant response.
2256</t>
2257<t>
2258   When multiple Warning headers are attached to a response, the user
2259   agent ought to inform the user of as many of them as possible, in the
2260   order that they appear in the response. If it is not possible to
2261   inform the user of all of the warnings, the user agent &SHOULD; follow
2262   these heuristics:
2263  <list style="symbols">
2264    <t>Warnings that appear early in the response take priority over
2265        those appearing later in the response.</t>
2266
2267    <t>Warnings in the user's preferred character set take priority
2268        over warnings in other character sets but with identical warn-codes
2269        and warn-agents.</t>
2270  </list>
2271</t>
2272<t>
2273   Systems that generate multiple Warning headers &SHOULD; order them with
2274   this user agent behavior in mind.
2275</t>
2276<t>
2277   Requirements for the behavior of caches with respect to Warnings are
2278   stated in <xref target="warnings"/>.
2279</t>
2280<t>
2281   This is a list of the currently-defined warn-codes, each with a
2282   recommended warn-text in English, and a description of its meaning.
2283</t>
2284<t>
2285   110 Response is stale
2286  <list><t>
2287     &MUST; be included whenever the returned response is stale.
2288  </t></list>
2289</t>
2290<t>
2291   111 Revalidation failed
2292  <list><t>
2293     &MUST; be included if a cache returns a stale response because an
2294     attempt to revalidate the response failed, due to an inability to
2295     reach the server.
2296  </t></list>
2297</t>
2298<t>
2299   112 Disconnected operation
2300  <list><t>
2301     &SHOULD; be included if the cache is intentionally disconnected from
2302     the rest of the network for a period of time.
2303  </t></list>
2304</t>
2305<t>
2306   113 Heuristic expiration
2307  <list><t>
2308     &MUST; be included if the cache heuristically chose a freshness
2309     lifetime greater than 24 hours and the response's age is greater
2310     than 24 hours.
2311  </t></list>
2312</t>
2313<t>
2314   199 Miscellaneous warning
2315  <list><t>
2316     The warning text &MAY; include arbitrary information to be presented
2317     to a human user, or logged. A system receiving this warning &MUST-NOT;
2318     take any automated action, besides presenting the warning to
2319     the user.
2320  </t></list>
2321</t>
2322<t>
2323   214 Transformation applied
2324  <list><t>
2325     &MUST; be added by an intermediate cache or proxy if it applies any
2326     transformation changing the content-coding (as specified in the
2327     Content-Encoding header) or media-type (as specified in the
2328     Content-Type header) of the response, or the entity-body of the
2329     response, unless this Warning code already appears in the response.
2330  </t></list>
2331</t>
2332<t>
2333   299 Miscellaneous persistent warning
2334  <list><t>
2335     The warning text &MAY; include arbitrary information to be presented
2336     to a human user, or logged. A system receiving this warning &MUST-NOT;
2337     take any automated action.
2338  </t></list>
2339</t>
2340<t>
2341   If an implementation sends a message with one or more Warning headers
2342   whose version is HTTP/1.0 or lower, then the sender &MUST; include in
2343   each warning-value a warn-date that matches the date in the response.
2344</t>
2345<t>
2346   If an implementation receives a message with a warning-value that
2347   includes a warn-date, and that warn-date is different from the Date
2348   value in the response, then that warning-value &MUST; be deleted from
2349   the message before storing, forwarding, or using it. (This prevents
2350   bad consequences of naive caching of Warning header fields.) If all
2351   of the warning-values are deleted for this reason, the Warning header
2352   &MUST; be deleted as well.
2353</t>
2354</section>
2355
2356</section>
2357
2358<section title="IANA Considerations" anchor="IANA.considerations">
2359<t>
2360   TBD.
2361</t>
2362</section>
2363
2364<section title="Security Considerations" anchor="security.considerations">
2365<t>
2366   Caching proxies provide additional potential vulnerabilities, since
2367   the contents of the cache represent an attractive target for
2368   malicious exploitation. Because cache contents persist after an HTTP
2369   request is complete, an attack on the cache can reveal information
2370   long after a user believes that the information has been removed from
2371   the network. Therefore, cache contents should be protected as
2372   sensitive information.
2373</t>
2374</section>
2375
2376<section title="Acknowledgments" anchor="ack">
2377<t>
2378   Much of the content and presentation of the caching design is due to
2379   suggestions and comments from individuals including: Shel Kaphan,
2380   Paul Leach, Koen Holtman, David Morris, and Larry Masinter.
2381</t>
2382<t>
2383   Based on an XML translation of RFC 2616 by Julian Reschke.
2384</t>
2385</section>
2386</middle>
2387<back>
2388<references>
2389
2390<reference anchor="Part1">
2391  <front>
2392    <title abbrev="HTTP/1.1">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</title>
2393 
2394    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
2395      <organization abbrev="Day Software">Day Software</organization>
2396      <address>
2397        <email>fielding@gbiv.com</email>
2398      </address>
2399    </author>
2400 
2401    <author initials="J." surname="Gettys" fullname="Jim Gettys">
2402      <organization>One Laptop per Child</organization>
2403      <address>
2404        <email>jg@laptop.org</email>
2405      </address>
2406    </author>
2407   
2408    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
2409      <organization abbrev="HP">Hewlett-Packard Company</organization>
2410      <address>
2411        <email>JeffMogul@acm.org</email>
2412      </address>
2413    </author>
2414 
2415    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
2416      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2417      <address>
2418        <email>henrikn@microsoft.com</email>
2419      </address>
2420    </author>
2421 
2422    <author initials="L." surname="Masinter" fullname="Larry Masinter">
2423      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
2424      <address>
2425        <email>LMM@acm.org</email>
2426      </address>
2427    </author>
2428   
2429    <author initials="P." surname="Leach" fullname="Paul J. Leach">
2430      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2431      <address>
2432        <email>paulle@microsoft.com</email>
2433      </address>
2434    </author>
2435     
2436    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
2437      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
2438      <address>
2439        <email>timbl@w3.org</email>
2440      </address>
2441    </author>
2442 
2443    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
2444  </front>
2445  <seriesInfo name="Internet-Draft" value="draft-fielding-p1-messaging-&ID-VERSION;"/>
2446  <x:source href="p1-messaging.xml" basename="p1-messaging"/>
2447</reference>
2448
2449<reference anchor="Part2">
2450  <front>
2451    <title abbrev="HTTP/1.1">HTTP/1.1, part 2: Message Semantics</title>
2452 
2453    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
2454      <organization abbrev="Day Software">Day Software</organization>
2455      <address>
2456        <email>fielding@gbiv.com</email>
2457      </address>
2458    </author>
2459 
2460    <author initials="J." surname="Gettys" fullname="Jim Gettys">
2461      <organization>One Laptop per Child</organization>
2462      <address>
2463        <email>jg@laptop.org</email>
2464      </address>
2465    </author>
2466   
2467    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
2468      <organization abbrev="HP">Hewlett-Packard Company</organization>
2469      <address>
2470        <email>JeffMogul@acm.org</email>
2471      </address>
2472    </author>
2473 
2474    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
2475      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2476      <address>
2477        <email>henrikn@microsoft.com</email>
2478      </address>
2479    </author>
2480 
2481    <author initials="L." surname="Masinter" fullname="Larry Masinter">
2482      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
2483      <address>
2484        <email>LMM@acm.org</email>
2485      </address>
2486    </author>
2487   
2488    <author initials="P." surname="Leach" fullname="Paul J. Leach">
2489      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2490      <address>
2491        <email>paulle@microsoft.com</email>
2492      </address>
2493    </author>
2494     
2495    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
2496      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
2497      <address>
2498        <email>timbl@w3.org</email>
2499      </address>
2500    </author>
2501 
2502    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
2503  </front>
2504  <seriesInfo name="Internet-Draft" value="draft-fielding-p2-semantics-&ID-VERSION;"/>
2505  <x:source href="p2-semantics.xml" basename="p2-semantics"/>
2506</reference>
2507
2508<reference anchor="Part3">
2509  <front>
2510    <title abbrev="HTTP/1.1">HTTP/1.1, part 3: Message Payload and Content Negotiation</title>
2511 
2512    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
2513      <organization abbrev="Day Software">Day Software</organization>
2514      <address>
2515        <email>fielding@gbiv.com</email>
2516      </address>
2517    </author>
2518 
2519    <author initials="J." surname="Gettys" fullname="Jim Gettys">
2520      <organization>One Laptop per Child</organization>
2521      <address>
2522        <email>jg@laptop.org</email>
2523      </address>
2524    </author>
2525   
2526    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
2527      <organization abbrev="HP">Hewlett-Packard Company</organization>
2528      <address>
2529        <email>JeffMogul@acm.org</email>
2530      </address>
2531    </author>
2532 
2533    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
2534      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2535      <address>
2536        <email>henrikn@microsoft.com</email>
2537      </address>
2538    </author>
2539 
2540    <author initials="L." surname="Masinter" fullname="Larry Masinter">
2541      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
2542      <address>
2543        <email>LMM@acm.org</email>
2544      </address>
2545    </author>
2546   
2547    <author initials="P." surname="Leach" fullname="Paul J. Leach">
2548      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2549      <address>
2550        <email>paulle@microsoft.com</email>
2551      </address>
2552    </author>
2553     
2554    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
2555      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
2556      <address>
2557        <email>timbl@w3.org</email>
2558      </address>
2559    </author>
2560 
2561    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
2562  </front>
2563  <seriesInfo name="Internet-Draft" value="draft-fielding-p3-payload-&ID-VERSION;"/>
2564  <x:source href="p3-payload.xml" basename="p3-payload"/>
2565</reference>
2566
2567<reference anchor="Part4">
2568  <front>
2569    <title abbrev="HTTP/1.1">HTTP/1.1, part 4: Conditional Requests</title>
2570 
2571    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
2572      <organization abbrev="Day Software">Day Software</organization>
2573      <address>
2574        <email>fielding@gbiv.com</email>
2575      </address>
2576    </author>
2577 
2578    <author initials="J." surname="Gettys" fullname="Jim Gettys">
2579      <organization>One Laptop per Child</organization>
2580      <address>
2581        <email>jg@laptop.org</email>
2582      </address>
2583    </author>
2584   
2585    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
2586      <organization abbrev="HP">Hewlett-Packard Company</organization>
2587      <address>
2588        <email>JeffMogul@acm.org</email>
2589      </address>
2590    </author>
2591 
2592    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
2593      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2594      <address>
2595        <email>henrikn@microsoft.com</email>
2596      </address>
2597    </author>
2598 
2599    <author initials="L." surname="Masinter" fullname="Larry Masinter">
2600      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
2601      <address>
2602        <email>LMM@acm.org</email>
2603      </address>
2604    </author>
2605   
2606    <author initials="P." surname="Leach" fullname="Paul J. Leach">
2607      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2608      <address>
2609        <email>paulle@microsoft.com</email>
2610      </address>
2611    </author>
2612     
2613    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
2614      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
2615      <address>
2616        <email>timbl@w3.org</email>
2617      </address>
2618    </author>
2619 
2620    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
2621  </front>
2622  <seriesInfo name="Internet-Draft" value="draft-fielding-p4-conditional-&ID-VERSION;"/>
2623  <x:source href="p4-conditional.xml" basename="p4-conditional"/>
2624</reference>
2625
2626<reference anchor="Part5">
2627  <front>
2628    <title abbrev="HTTP/1.1">HTTP/1.1, part 5: Range Requests and Partial Responses</title>
2629 
2630    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
2631      <organization abbrev="Day Software">Day Software</organization>
2632      <address>
2633        <email>fielding@gbiv.com</email>
2634      </address>
2635    </author>
2636 
2637    <author initials="J." surname="Gettys" fullname="Jim Gettys">
2638      <organization>One Laptop per Child</organization>
2639      <address>
2640        <email>jg@laptop.org</email>
2641      </address>
2642    </author>
2643   
2644    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
2645      <organization abbrev="HP">Hewlett-Packard Company</organization>
2646      <address>
2647        <email>JeffMogul@acm.org</email>
2648      </address>
2649    </author>
2650 
2651    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
2652      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2653      <address>
2654        <email>henrikn@microsoft.com</email>
2655      </address>
2656    </author>
2657 
2658    <author initials="L." surname="Masinter" fullname="Larry Masinter">
2659      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
2660      <address>
2661        <email>LMM@acm.org</email>
2662      </address>
2663    </author>
2664   
2665    <author initials="P." surname="Leach" fullname="Paul J. Leach">
2666      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2667      <address>
2668        <email>paulle@microsoft.com</email>
2669      </address>
2670    </author>
2671     
2672    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
2673      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
2674      <address>
2675        <email>timbl@w3.org</email>
2676      </address>
2677    </author>
2678 
2679    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
2680  </front>
2681  <seriesInfo name="Internet-Draft" value="draft-fielding-p5-range-&ID-VERSION;"/>
2682  <x:source href="p5-range.xml" basename="p5-range"/>
2683</reference>
2684
2685<reference anchor="Part7">
2686  <front>
2687    <title abbrev="HTTP/1.1">HTTP/1.1, part 7: Authentication</title>
2688 
2689    <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
2690      <organization abbrev="Day Software">Day Software</organization>
2691      <address>
2692        <email>fielding@gbiv.com</email>
2693      </address>
2694    </author>
2695 
2696    <author initials="J." surname="Gettys" fullname="Jim Gettys">
2697      <organization>One Laptop per Child</organization>
2698      <address>
2699        <email>jg@laptop.org</email>
2700      </address>
2701    </author>
2702   
2703    <author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
2704      <organization abbrev="HP">Hewlett-Packard Company</organization>
2705      <address>
2706        <email>JeffMogul@acm.org</email>
2707      </address>
2708    </author>
2709 
2710    <author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
2711      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2712      <address>
2713        <email>henrikn@microsoft.com</email>
2714      </address>
2715    </author>
2716 
2717    <author initials="L." surname="Masinter" fullname="Larry Masinter">
2718      <organization abbrev="Adobe Systems">Adobe Systems, Incorporated</organization>
2719      <address>
2720        <email>LMM@acm.org</email>
2721      </address>
2722    </author>
2723   
2724    <author initials="P." surname="Leach" fullname="Paul J. Leach">
2725      <organization abbrev="Microsoft">Microsoft Corporation</organization>
2726      <address>
2727        <email>paulle@microsoft.com</email>
2728      </address>
2729    </author>
2730     
2731    <author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
2732      <organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
2733      <address>
2734        <email>timbl@w3.org</email>
2735      </address>
2736    </author>
2737 
2738    <date month="&ID-MONTH;" year="&ID-YEAR;"/>
2739  </front>
2740  <seriesInfo name="Internet-Draft" value="draft-fielding-p7-auth-&ID-VERSION;"/>
2741  <x:source href="p7-auth.xml" basename="p7-auth"/>
2742</reference>
2743
2744<reference anchor="RFC2047">
2745<front>
2746<title abbrev="Message Header Extensions">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</title>
2747<author initials="K." surname="Moore" fullname="Keith Moore">
2748<organization>University of Tennessee</organization>
2749<address>
2750<postal>
2751<street>107 Ayres Hall</street>
2752<street>Knoxville TN 37996-1301</street></postal>
2753<email>moore@cs.utk.edu</email></address></author>
2754<date month="November" year="1996"/>
2755<area>Applications</area>
2756<keyword>Amercian Standard Code for Information Interchange</keyword>
2757<keyword>mail</keyword>
2758<keyword>multipurpose internet mail extensions</keyword>
2759</front>
2760<seriesInfo name="RFC" value="2047"/>
2761</reference>
2762
2763<reference anchor="RFC1305">
2764<front>
2765<title>Network Time Protocol (Version 3) Specification, Implementation</title>
2766<author initials="D." surname="Mills" fullname="David L. Mills">
2767<organization>University of Delaware, Electrical Engineering Department</organization>
2768<address>
2769<postal>
2770<street/>
2771<city>Newark</city>
2772<region>DE</region>
2773<code>19716</code>
2774<country>US</country></postal>
2775<phone>+1 302 451 8247</phone>
2776<email>mills@udel.edu</email></address></author>
2777<date month="March" year="1992"/>
2778<abstract>
2779<t>This document describes the Network Time Protocol (NTP), specifies its normal structure and summarizes information useful for its implementation. NTP provides the mechanisms to synchronize time and coordinate time distribution in a large, diverse internet operating at rates from mundane to lightwave. It uses a returnable-time design in which a distributed subnet of time servers operating in a self-organizing, hierarchical-master-slave configuration synchronizes local clocks within the subnet and to national time standards via wire or radio. The servers can also redistribute reference time via local routing algorithms and time daemons.</t></abstract></front>
2780<seriesInfo name="RFC" value="1305"/>
2781</reference>
2782
2783<reference anchor="RFC2616">
2784  <front>
2785    <title>Hypertext Transfer Protocol -- HTTP/1.1</title>
2786    <author initials="R." surname="Fielding" fullname="R. Fielding">
2787      <organization>University of California, Irvine</organization>
2788      <address><email>fielding@ics.uci.edu</email></address>
2789    </author>
2790    <author initials="J." surname="Gettys" fullname="J. Gettys">
2791      <organization>W3C</organization>
2792      <address><email>jg@w3.org</email></address>
2793    </author>
2794    <author initials="J." surname="Mogul" fullname="J. Mogul">
2795      <organization>Compaq Computer Corporation</organization>
2796      <address><email>mogul@wrl.dec.com</email></address>
2797    </author>
2798    <author initials="H." surname="Frystyk" fullname="H. Frystyk">
2799      <organization>MIT Laboratory for Computer Science</organization>
2800      <address><email>frystyk@w3.org</email></address>
2801    </author>
2802    <author initials="L." surname="Masinter" fullname="L. Masinter">
2803      <organization>Xerox Corporation</organization>
2804      <address><email>masinter@parc.xerox.com</email></address>
2805    </author>
2806    <author initials="P." surname="Leach" fullname="P. Leach">
2807      <organization>Microsoft Corporation</organization>
2808      <address><email>paulle@microsoft.com</email></address>
2809    </author>
2810    <author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
2811      <organization>W3C</organization>
2812      <address><email>timbl@w3.org</email></address>
2813    </author>
2814    <date month="June" year="1999"/>
2815  </front>
2816  <seriesInfo name="RFC" value="2616"/>
2817</reference>
2818</references>
2819
2820<section title="Changes from RFC 2068" anchor="changes.from.rfc.2068">
2821<t>
2822   A case was missed in the Cache-Control model of HTTP/1.1; s-maxage
2823   was introduced to add this missing case. (Sections <xref target="response.cacheability" format="counter"/>,
2824   <xref target="header.cache-control" format="counter"/>,
2825   <xref target="modifications.of.the.basic.expiration.mechanism" format="counter"/>)
2826</t>
2827<t>
2828   The Cache-Control: max-age directive was not properly defined for
2829   responses. (<xref target="modifications.of.the.basic.expiration.mechanism"/>)
2830</t>
2831<t>
2832   Warnings could be cached incorrectly, or not updated appropriately.
2833   (Section <xref target="warnings" format="counter"/>, <xref target="expiration.calculations" format="counter"/>, <xref target="non-modifiable.headers" format="counter"/>,
2834   <xref target="combining.headers" format="counter"/>, <xref target="modifications.of.the.basic.expiration.mechanism" format="counter"/>,
2835   and <xref target="header.warning" format="counter"/>) Warning
2836   also needed to be a general header, as PUT or other methods may have
2837   need for it in requests.
2838</t>
2839</section>
2840</back>
2841</rfc>
Note: See TracBrowser for help on using the repository browser.