source: draft-ietf-httpbis/19/draft-ietf-httpbis-p6-cache-19.txt @ 1781

Last change on this file since 1781 was 1596, checked in by fielding@…, 8 years ago

remove executable bit

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