1 | <!DOCTYPE html |
---|
2 | PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
---|
3 | <html lang="en"> |
---|
4 | <head profile="http://dublincore.org/documents/2008/08/04/dc-html/"> |
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
6 | <title>HTTP/1.1, part 6: Caching</title><style type="text/css" title="Xml2Rfc (sans serif)"> |
---|
7 | a { |
---|
8 | text-decoration: none; |
---|
9 | } |
---|
10 | a.smpl { |
---|
11 | color: black; |
---|
12 | } |
---|
13 | a:hover { |
---|
14 | text-decoration: underline; |
---|
15 | } |
---|
16 | a:active { |
---|
17 | text-decoration: underline; |
---|
18 | } |
---|
19 | address { |
---|
20 | margin-top: 1em; |
---|
21 | margin-left: 2em; |
---|
22 | font-style: normal; |
---|
23 | } |
---|
24 | body { |
---|
25 | color: black; |
---|
26 | font-family: cambria, helvetica, arial, sans-serif; |
---|
27 | font-size: 11pt; |
---|
28 | margin-right: 2em; |
---|
29 | } |
---|
30 | cite { |
---|
31 | font-style: normal; |
---|
32 | } |
---|
33 | dl { |
---|
34 | margin-left: 2em; |
---|
35 | } |
---|
36 | ul.empty { |
---|
37 | list-style-type: none; |
---|
38 | } |
---|
39 | ul.empty li { |
---|
40 | margin-top: .5em; |
---|
41 | } |
---|
42 | dl p { |
---|
43 | margin-left: 0em; |
---|
44 | } |
---|
45 | dt { |
---|
46 | margin-top: .5em; |
---|
47 | } |
---|
48 | h1 { |
---|
49 | font-size: 130%; |
---|
50 | line-height: 21pt; |
---|
51 | page-break-after: avoid; |
---|
52 | } |
---|
53 | h1.np { |
---|
54 | page-break-before: always; |
---|
55 | } |
---|
56 | h2 { |
---|
57 | font-size: 120%; |
---|
58 | line-height: 15pt; |
---|
59 | page-break-after: avoid; |
---|
60 | } |
---|
61 | h3 { |
---|
62 | font-size: 110%; |
---|
63 | page-break-after: avoid; |
---|
64 | } |
---|
65 | h4, h5, h6 { |
---|
66 | page-break-after: avoid; |
---|
67 | } |
---|
68 | h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { |
---|
69 | color: black; |
---|
70 | } |
---|
71 | img { |
---|
72 | margin-left: 3em; |
---|
73 | } |
---|
74 | li { |
---|
75 | margin-left: 2em; |
---|
76 | } |
---|
77 | ol { |
---|
78 | margin-left: 2em; |
---|
79 | } |
---|
80 | ol.la { |
---|
81 | list-style-type: lower-alpha; |
---|
82 | } |
---|
83 | ol.ua { |
---|
84 | list-style-type: upper-alpha; |
---|
85 | } |
---|
86 | ol p { |
---|
87 | margin-left: 0em; |
---|
88 | } |
---|
89 | p { |
---|
90 | margin-left: 2em; |
---|
91 | } |
---|
92 | pre { |
---|
93 | margin-left: 3em; |
---|
94 | background-color: lightyellow; |
---|
95 | padding: .25em; |
---|
96 | page-break-inside: avoid; |
---|
97 | } |
---|
98 | pre.text2 { |
---|
99 | border-style: dotted; |
---|
100 | border-width: 1px; |
---|
101 | background-color: #f0f0f0; |
---|
102 | width: 69em; |
---|
103 | } |
---|
104 | pre.inline { |
---|
105 | background-color: white; |
---|
106 | padding: 0em; |
---|
107 | } |
---|
108 | pre.text { |
---|
109 | border-style: dotted; |
---|
110 | border-width: 1px; |
---|
111 | background-color: #f8f8f8; |
---|
112 | width: 69em; |
---|
113 | } |
---|
114 | pre.drawing { |
---|
115 | border-style: solid; |
---|
116 | border-width: 1px; |
---|
117 | background-color: #f8f8f8; |
---|
118 | padding: 2em; |
---|
119 | } |
---|
120 | sup { |
---|
121 | font-size: 60%; |
---|
122 | } |
---|
123 | table { |
---|
124 | margin-left: 2em; |
---|
125 | } |
---|
126 | table.tt { |
---|
127 | vertical-align: top; |
---|
128 | border-color: gray; |
---|
129 | } |
---|
130 | table.tt th { |
---|
131 | border-color: gray; |
---|
132 | } |
---|
133 | table.tt td { |
---|
134 | border-color: gray; |
---|
135 | } |
---|
136 | table.all { |
---|
137 | border-style: solid; |
---|
138 | border-width: 2px; |
---|
139 | } |
---|
140 | table.full { |
---|
141 | border-style: solid; |
---|
142 | border-width: 2px; |
---|
143 | } |
---|
144 | table.tt td { |
---|
145 | vertical-align: top; |
---|
146 | } |
---|
147 | table.all td { |
---|
148 | border-style: solid; |
---|
149 | border-width: 1px; |
---|
150 | } |
---|
151 | table.full td { |
---|
152 | border-style: none solid; |
---|
153 | border-width: 1px; |
---|
154 | } |
---|
155 | table.tt th { |
---|
156 | vertical-align: top; |
---|
157 | } |
---|
158 | table.all th { |
---|
159 | border-style: solid; |
---|
160 | border-width: 1px; |
---|
161 | } |
---|
162 | table.full th { |
---|
163 | border-style: solid; |
---|
164 | border-width: 1px 1px 2px 1px; |
---|
165 | } |
---|
166 | table.headers th { |
---|
167 | border-style: none none solid none; |
---|
168 | border-width: 2px; |
---|
169 | } |
---|
170 | table.left { |
---|
171 | margin-right: auto; |
---|
172 | } |
---|
173 | table.right { |
---|
174 | margin-left: auto; |
---|
175 | } |
---|
176 | table.center { |
---|
177 | margin-left: auto; |
---|
178 | margin-right: auto; |
---|
179 | } |
---|
180 | caption { |
---|
181 | caption-side: bottom; |
---|
182 | font-weight: bold; |
---|
183 | font-size: 10pt; |
---|
184 | margin-top: .5em; |
---|
185 | } |
---|
186 | |
---|
187 | table.header { |
---|
188 | border-spacing: 1px; |
---|
189 | width: 95%; |
---|
190 | font-size: 11pt; |
---|
191 | color: white; |
---|
192 | } |
---|
193 | td.top { |
---|
194 | vertical-align: top; |
---|
195 | } |
---|
196 | td.topnowrap { |
---|
197 | vertical-align: top; |
---|
198 | white-space: nowrap; |
---|
199 | } |
---|
200 | table.header td { |
---|
201 | background-color: gray; |
---|
202 | width: 50%; |
---|
203 | } |
---|
204 | table.header a { |
---|
205 | color: white; |
---|
206 | } |
---|
207 | td.reference { |
---|
208 | vertical-align: top; |
---|
209 | white-space: nowrap; |
---|
210 | padding-right: 1em; |
---|
211 | } |
---|
212 | thead { |
---|
213 | display:table-header-group; |
---|
214 | } |
---|
215 | ul.toc, ul.toc ul { |
---|
216 | list-style: none; |
---|
217 | margin-left: 1.5em; |
---|
218 | padding-left: 0em; |
---|
219 | } |
---|
220 | ul.toc li { |
---|
221 | line-height: 150%; |
---|
222 | font-weight: bold; |
---|
223 | margin-left: 0em; |
---|
224 | } |
---|
225 | ul.toc li li { |
---|
226 | line-height: normal; |
---|
227 | font-weight: normal; |
---|
228 | font-size: 10pt; |
---|
229 | margin-left: 0em; |
---|
230 | } |
---|
231 | li.excluded { |
---|
232 | font-size: 0pt; |
---|
233 | } |
---|
234 | ul p { |
---|
235 | margin-left: 0em; |
---|
236 | } |
---|
237 | .title, .filename, h1, h2, h3, h4 { |
---|
238 | font-family: candara, helvetica, arial, sans-serif; |
---|
239 | } |
---|
240 | samp, tt, code, pre { |
---|
241 | font: consolas, monospace; |
---|
242 | } |
---|
243 | ul.ind, ul.ind ul { |
---|
244 | list-style: none; |
---|
245 | margin-left: 1.5em; |
---|
246 | padding-left: 0em; |
---|
247 | page-break-before: avoid; |
---|
248 | } |
---|
249 | ul.ind li { |
---|
250 | font-weight: bold; |
---|
251 | line-height: 200%; |
---|
252 | margin-left: 0em; |
---|
253 | } |
---|
254 | ul.ind li li { |
---|
255 | font-weight: normal; |
---|
256 | line-height: 150%; |
---|
257 | margin-left: 0em; |
---|
258 | } |
---|
259 | .avoidbreak { |
---|
260 | page-break-inside: avoid; |
---|
261 | } |
---|
262 | .bcp14 { |
---|
263 | font-style: normal; |
---|
264 | text-transform: lowercase; |
---|
265 | font-variant: small-caps; |
---|
266 | } |
---|
267 | .comment { |
---|
268 | background-color: yellow; |
---|
269 | } |
---|
270 | .center { |
---|
271 | text-align: center; |
---|
272 | } |
---|
273 | .error { |
---|
274 | color: red; |
---|
275 | font-style: italic; |
---|
276 | font-weight: bold; |
---|
277 | } |
---|
278 | .figure { |
---|
279 | font-weight: bold; |
---|
280 | text-align: center; |
---|
281 | font-size: 10pt; |
---|
282 | } |
---|
283 | .filename { |
---|
284 | color: #333333; |
---|
285 | font-size: 75%; |
---|
286 | font-weight: bold; |
---|
287 | line-height: 21pt; |
---|
288 | text-align: center; |
---|
289 | } |
---|
290 | .fn { |
---|
291 | font-weight: bold; |
---|
292 | } |
---|
293 | .left { |
---|
294 | text-align: left; |
---|
295 | } |
---|
296 | .right { |
---|
297 | text-align: right; |
---|
298 | } |
---|
299 | .title { |
---|
300 | color: green; |
---|
301 | font-size: 150%; |
---|
302 | line-height: 18pt; |
---|
303 | font-weight: bold; |
---|
304 | text-align: center; |
---|
305 | margin-top: 36pt; |
---|
306 | } |
---|
307 | .warning { |
---|
308 | font-size: 130%; |
---|
309 | background-color: yellow; |
---|
310 | } |
---|
311 | |
---|
312 | |
---|
313 | @media print { |
---|
314 | .noprint { |
---|
315 | display: none; |
---|
316 | } |
---|
317 | |
---|
318 | a { |
---|
319 | color: black; |
---|
320 | text-decoration: none; |
---|
321 | } |
---|
322 | |
---|
323 | table.header { |
---|
324 | width: 90%; |
---|
325 | } |
---|
326 | |
---|
327 | td.header { |
---|
328 | width: 50%; |
---|
329 | color: black; |
---|
330 | background-color: white; |
---|
331 | vertical-align: top; |
---|
332 | font-size: 110%; |
---|
333 | } |
---|
334 | |
---|
335 | ul.toc a:nth-child(2)::after { |
---|
336 | content: leader('.') target-counter(attr(href), page); |
---|
337 | } |
---|
338 | |
---|
339 | ul.ind li li a { |
---|
340 | content: target-counter(attr(href), page); |
---|
341 | } |
---|
342 | |
---|
343 | .print2col { |
---|
344 | column-count: 2; |
---|
345 | -moz-column-count: 2; |
---|
346 | column-fill: auto; |
---|
347 | } |
---|
348 | } |
---|
349 | |
---|
350 | @page { |
---|
351 | @top-left { |
---|
352 | content: "Internet-Draft"; |
---|
353 | } |
---|
354 | @top-right { |
---|
355 | content: "August 2008"; |
---|
356 | } |
---|
357 | @top-center { |
---|
358 | content: "HTTP/1.1, Part 6"; |
---|
359 | } |
---|
360 | @bottom-left { |
---|
361 | content: "Fielding, et al."; |
---|
362 | } |
---|
363 | @bottom-center { |
---|
364 | content: "Expires March 2, 2009"; |
---|
365 | } |
---|
366 | @bottom-right { |
---|
367 | content: "[Page " counter(page) "]"; |
---|
368 | } |
---|
369 | } |
---|
370 | |
---|
371 | @page:first { |
---|
372 | @top-left { |
---|
373 | content: normal; |
---|
374 | } |
---|
375 | @top-right { |
---|
376 | content: normal; |
---|
377 | } |
---|
378 | @top-center { |
---|
379 | content: normal; |
---|
380 | } |
---|
381 | } |
---|
382 | </style><link rel="Contents" href="#rfc.toc"> |
---|
383 | <link rel="Author" href="#rfc.authors"> |
---|
384 | <link rel="Copyright" href="#rfc.copyright"> |
---|
385 | <link rel="Index" href="#rfc.index"> |
---|
386 | <link rel="Chapter" title="1 Introduction" href="#rfc.section.1"> |
---|
387 | <link rel="Chapter" title="2 Notational Conventions and Generic Grammar" href="#rfc.section.2"> |
---|
388 | <link rel="Chapter" title="3 Overview" href="#rfc.section.3"> |
---|
389 | <link rel="Chapter" title="4 Expiration Model" href="#rfc.section.4"> |
---|
390 | <link rel="Chapter" title="5 Validation Model" href="#rfc.section.5"> |
---|
391 | <link rel="Chapter" title="6 Response Cacheability" href="#rfc.section.6"> |
---|
392 | <link rel="Chapter" title="7 Constructing Responses From Caches" href="#rfc.section.7"> |
---|
393 | <link rel="Chapter" title="8 Caching Negotiated Responses" href="#rfc.section.8"> |
---|
394 | <link rel="Chapter" title="9 Shared and Non-Shared Caches" href="#rfc.section.9"> |
---|
395 | <link rel="Chapter" title="10 Errors or Incomplete Response Cache Behavior" href="#rfc.section.10"> |
---|
396 | <link rel="Chapter" title="11 Side Effects of GET and HEAD" href="#rfc.section.11"> |
---|
397 | <link rel="Chapter" title="12 Invalidation After Updates or Deletions" href="#rfc.section.12"> |
---|
398 | <link rel="Chapter" title="13 Write-Through Mandatory" href="#rfc.section.13"> |
---|
399 | <link rel="Chapter" title="14 Cache Replacement" href="#rfc.section.14"> |
---|
400 | <link rel="Chapter" title="15 History Lists" href="#rfc.section.15"> |
---|
401 | <link rel="Chapter" title="16 Header Field Definitions" href="#rfc.section.16"> |
---|
402 | <link rel="Chapter" title="17 IANA Considerations" href="#rfc.section.17"> |
---|
403 | <link rel="Chapter" title="18 Security Considerations" href="#rfc.section.18"> |
---|
404 | <link rel="Chapter" title="19 Acknowledgments" href="#rfc.section.19"> |
---|
405 | <link rel="Chapter" href="#rfc.section.20" title="20 References"> |
---|
406 | <link rel="Appendix" title="A Compatibility with Previous Versions" href="#rfc.section.A"> |
---|
407 | <link rel="Appendix" title="B Change Log (to be removed by RFC Editor before publication)" href="#rfc.section.B"> |
---|
408 | <meta name="generator" content="http://greenbytes.de/tech/webdav/rfc2629.xslt, Revision 1.640, 2014/06/13 12:42:58, XSLT vendor: SAXON 8.9 from Saxonica http://www.saxonica.com/"> |
---|
409 | <link rel="schema.dct" href="http://purl.org/dc/terms/"> |
---|
410 | <meta name="dct.creator" content="Fielding, R."> |
---|
411 | <meta name="dct.creator" content="Gettys, J."> |
---|
412 | <meta name="dct.creator" content="Mogul, J."> |
---|
413 | <meta name="dct.creator" content="Frystyk, H."> |
---|
414 | <meta name="dct.creator" content="Masinter, L."> |
---|
415 | <meta name="dct.creator" content="Leach, P."> |
---|
416 | <meta name="dct.creator" content="Berners-Lee, T."> |
---|
417 | <meta name="dct.creator" content="Lafon, Y."> |
---|
418 | <meta name="dct.creator" content="Reschke, J. F."> |
---|
419 | <meta name="dct.identifier" content="urn:ietf:id:draft-ietf-httpbis-p6-cache-04"> |
---|
420 | <meta name="dct.issued" scheme="ISO8601" content="2008-08-29"> |
---|
421 | <meta name="dct.replaces" content="urn:ietf:rfc:2616"> |
---|
422 | <meta name="dct.abstract" content="The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. HTTP has been in use by the World Wide Web global information initiative since 1990. This document is Part 6 of the seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part 6 defines requirements on HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages."> |
---|
423 | <meta name="description" content="The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. HTTP has been in use by the World Wide Web global information initiative since 1990. This document is Part 6 of the seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part 6 defines requirements on HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages."> |
---|
424 | </head> |
---|
425 | <body> |
---|
426 | <table class="header"> |
---|
427 | <tbody> |
---|
428 | <tr> |
---|
429 | <td class="left">Network Working Group</td> |
---|
430 | <td class="right">R. Fielding, Editor</td> |
---|
431 | </tr> |
---|
432 | <tr> |
---|
433 | <td class="left">Internet-Draft</td> |
---|
434 | <td class="right">Day Software</td> |
---|
435 | </tr> |
---|
436 | <tr> |
---|
437 | <td class="left">Obsoletes: <a href="https://tools.ietf.org/html/rfc2616">2616</a> (if approved) |
---|
438 | </td> |
---|
439 | <td class="right">J. Gettys</td> |
---|
440 | </tr> |
---|
441 | <tr> |
---|
442 | <td class="left">Intended status: Standards Track</td> |
---|
443 | <td class="right">One Laptop per Child</td> |
---|
444 | </tr> |
---|
445 | <tr> |
---|
446 | <td class="left">Expires: March 2, 2009</td> |
---|
447 | <td class="right">J. Mogul</td> |
---|
448 | </tr> |
---|
449 | <tr> |
---|
450 | <td class="left"></td> |
---|
451 | <td class="right">HP</td> |
---|
452 | </tr> |
---|
453 | <tr> |
---|
454 | <td class="left"></td> |
---|
455 | <td class="right">H. Frystyk</td> |
---|
456 | </tr> |
---|
457 | <tr> |
---|
458 | <td class="left"></td> |
---|
459 | <td class="right">Microsoft</td> |
---|
460 | </tr> |
---|
461 | <tr> |
---|
462 | <td class="left"></td> |
---|
463 | <td class="right">L. Masinter</td> |
---|
464 | </tr> |
---|
465 | <tr> |
---|
466 | <td class="left"></td> |
---|
467 | <td class="right">Adobe Systems</td> |
---|
468 | </tr> |
---|
469 | <tr> |
---|
470 | <td class="left"></td> |
---|
471 | <td class="right">P. Leach</td> |
---|
472 | </tr> |
---|
473 | <tr> |
---|
474 | <td class="left"></td> |
---|
475 | <td class="right">Microsoft</td> |
---|
476 | </tr> |
---|
477 | <tr> |
---|
478 | <td class="left"></td> |
---|
479 | <td class="right">T. Berners-Lee</td> |
---|
480 | </tr> |
---|
481 | <tr> |
---|
482 | <td class="left"></td> |
---|
483 | <td class="right">W3C/MIT</td> |
---|
484 | </tr> |
---|
485 | <tr> |
---|
486 | <td class="left"></td> |
---|
487 | <td class="right">Y. Lafon, Editor</td> |
---|
488 | </tr> |
---|
489 | <tr> |
---|
490 | <td class="left"></td> |
---|
491 | <td class="right">W3C</td> |
---|
492 | </tr> |
---|
493 | <tr> |
---|
494 | <td class="left"></td> |
---|
495 | <td class="right">J. Reschke, Editor</td> |
---|
496 | </tr> |
---|
497 | <tr> |
---|
498 | <td class="left"></td> |
---|
499 | <td class="right">greenbytes</td> |
---|
500 | </tr> |
---|
501 | <tr> |
---|
502 | <td class="left"></td> |
---|
503 | <td class="right">August 29, 2008</td> |
---|
504 | </tr> |
---|
505 | </tbody> |
---|
506 | </table> |
---|
507 | <p class="title">HTTP/1.1, part 6: Caching<br><span class="filename">draft-ietf-httpbis-p6-cache-04</span></p> |
---|
508 | <div id="rfc.status"> |
---|
509 | <h1><a href="#rfc.status">Status of this Memo</a></h1> |
---|
510 | <p>By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she |
---|
511 | is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section |
---|
512 | 6 of BCP 79. |
---|
513 | </p> |
---|
514 | <p>Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note |
---|
515 | that other groups may also distribute working documents as Internet-Drafts. |
---|
516 | </p> |
---|
517 | <p>Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other |
---|
518 | documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as “work |
---|
519 | in progress”. |
---|
520 | </p> |
---|
521 | <p>The list of current Internet-Drafts can be accessed at <a href="http://www.ietf.org/ietf/1id-abstracts.txt">http://www.ietf.org/ietf/1id-abstracts.txt</a>. |
---|
522 | </p> |
---|
523 | <p>The list of Internet-Draft Shadow Directories can be accessed at <a href="http://www.ietf.org/shadow.html">http://www.ietf.org/shadow.html</a>. |
---|
524 | </p> |
---|
525 | <p>This Internet-Draft will expire on March 2, 2009.</p> |
---|
526 | </div> |
---|
527 | <h1 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h1> |
---|
528 | <p>The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information |
---|
529 | systems. HTTP has been in use by the World Wide Web global information initiative since 1990. This document is Part 6 of the |
---|
530 | seven-part specification that defines the protocol referred to as "HTTP/1.1" and, taken together, obsoletes RFC 2616. Part |
---|
531 | 6 defines requirements on HTTP caches and the associated header fields that control cache behavior or indicate cacheable response |
---|
532 | messages. |
---|
533 | </p> |
---|
534 | <h1 id="rfc.note.1"><a href="#rfc.note.1">Editorial Note (To be removed by RFC Editor)</a></h1> |
---|
535 | <p>Discussion of this draft should take place on the HTTPBIS working group mailing list (ietf-http-wg@w3.org). The current issues |
---|
536 | list is at <<a href="http://www.tools.ietf.org/wg/httpbis/trac/report/11">http://www.tools.ietf.org/wg/httpbis/trac/report/11</a>> and related documents (including fancy diffs) can be found at <<a href="http://www.tools.ietf.org/wg/httpbis/">http://www.tools.ietf.org/wg/httpbis/</a>>. |
---|
537 | </p> |
---|
538 | <p>The changes in this draft are summarized in <a href="#changes.since.02" title="Since draft-ietf-httpbis-p6-cache-02">Appendix B.4</a>. |
---|
539 | </p> |
---|
540 | <hr class="noprint"> |
---|
541 | <h1 class="np" id="rfc.toc"><a href="#rfc.toc">Table of Contents</a></h1> |
---|
542 | <ul class="toc"> |
---|
543 | <li><a href="#rfc.section.1">1.</a> <a href="#caching">Introduction</a><ul> |
---|
544 | <li><a href="#rfc.section.1.1">1.1</a> <a href="#intro.purpose">Purpose</a></li> |
---|
545 | <li><a href="#rfc.section.1.2">1.2</a> <a href="#intro.terminology">Terminology</a></li> |
---|
546 | <li><a href="#rfc.section.1.3">1.3</a> <a href="#intro.requirements">Requirements</a></li> |
---|
547 | </ul> |
---|
548 | </li> |
---|
549 | <li><a href="#rfc.section.2">2.</a> <a href="#notation">Notational Conventions and Generic Grammar</a></li> |
---|
550 | <li><a href="#rfc.section.3">3.</a> <a href="#caching.overview">Overview</a><ul> |
---|
551 | <li><a href="#rfc.section.3.1">3.1</a> <a href="#cache.correctness">Cache Correctness</a></li> |
---|
552 | <li><a href="#rfc.section.3.2">3.2</a> <a href="#warnings">Warnings</a></li> |
---|
553 | <li><a href="#rfc.section.3.3">3.3</a> <a href="#cache-control.mechanisms">Cache-control Mechanisms</a></li> |
---|
554 | <li><a href="#rfc.section.3.4">3.4</a> <a href="#explicit.ua.warnings">Explicit User Agent Warnings</a></li> |
---|
555 | <li><a href="#rfc.section.3.5">3.5</a> <a href="#exceptions.to.the.rules.and.warnings">Exceptions to the Rules and Warnings</a></li> |
---|
556 | <li><a href="#rfc.section.3.6">3.6</a> <a href="#client-controlled.behavior">Client-controlled Behavior</a></li> |
---|
557 | </ul> |
---|
558 | </li> |
---|
559 | <li><a href="#rfc.section.4">4.</a> <a href="#expiration.model">Expiration Model</a><ul> |
---|
560 | <li><a href="#rfc.section.4.1">4.1</a> <a href="#server-specified.expiration">Server-Specified Expiration</a></li> |
---|
561 | <li><a href="#rfc.section.4.2">4.2</a> <a href="#heuristic.expiration">Heuristic Expiration</a></li> |
---|
562 | <li><a href="#rfc.section.4.3">4.3</a> <a href="#age.calculations">Age Calculations</a></li> |
---|
563 | <li><a href="#rfc.section.4.4">4.4</a> <a href="#expiration.calculations">Expiration Calculations</a></li> |
---|
564 | <li><a href="#rfc.section.4.5">4.5</a> <a href="#disambiguating.expiration.values">Disambiguating Expiration Values</a></li> |
---|
565 | <li><a href="#rfc.section.4.6">4.6</a> <a href="#disambiguating.multiple.responses">Disambiguating Multiple Responses</a></li> |
---|
566 | </ul> |
---|
567 | </li> |
---|
568 | <li><a href="#rfc.section.5">5.</a> <a href="#validation.model">Validation Model</a></li> |
---|
569 | <li><a href="#rfc.section.6">6.</a> <a href="#response.cacheability">Response Cacheability</a></li> |
---|
570 | <li><a href="#rfc.section.7">7.</a> <a href="#constructing.responses.from.caches">Constructing Responses From Caches</a><ul> |
---|
571 | <li><a href="#rfc.section.7.1">7.1</a> <a href="#end-to-end.and.hop-by-hop.headers">End-to-end and Hop-by-hop Headers</a></li> |
---|
572 | <li><a href="#rfc.section.7.2">7.2</a> <a href="#non-modifiable.headers">Non-modifiable Headers</a></li> |
---|
573 | <li><a href="#rfc.section.7.3">7.3</a> <a href="#combining.headers">Combining Headers</a></li> |
---|
574 | </ul> |
---|
575 | </li> |
---|
576 | <li><a href="#rfc.section.8">8.</a> <a href="#caching.negotiated.responses">Caching Negotiated Responses</a></li> |
---|
577 | <li><a href="#rfc.section.9">9.</a> <a href="#shared.and.non-shared.caches">Shared and Non-Shared Caches</a></li> |
---|
578 | <li><a href="#rfc.section.10">10.</a> <a href="#errors.or.incomplete.response.cache.behavior">Errors or Incomplete Response Cache Behavior</a></li> |
---|
579 | <li><a href="#rfc.section.11">11.</a> <a href="#side.effects.of.get.and.head">Side Effects of GET and HEAD</a></li> |
---|
580 | <li><a href="#rfc.section.12">12.</a> <a href="#invalidation.after.updates.or.deletions">Invalidation After Updates or Deletions</a></li> |
---|
581 | <li><a href="#rfc.section.13">13.</a> <a href="#write-through.mandatory">Write-Through Mandatory</a></li> |
---|
582 | <li><a href="#rfc.section.14">14.</a> <a href="#cache.replacement">Cache Replacement</a></li> |
---|
583 | <li><a href="#rfc.section.15">15.</a> <a href="#history.lists">History Lists</a></li> |
---|
584 | <li><a href="#rfc.section.16">16.</a> <a href="#header.fields">Header Field Definitions</a><ul> |
---|
585 | <li><a href="#rfc.section.16.1">16.1</a> <a href="#header.age">Age</a></li> |
---|
586 | <li><a href="#rfc.section.16.2">16.2</a> <a href="#header.cache-control">Cache-Control</a><ul> |
---|
587 | <li><a href="#rfc.section.16.2.1">16.2.1</a> <a href="#what.is.cacheable">What is Cacheable</a></li> |
---|
588 | <li><a href="#rfc.section.16.2.2">16.2.2</a> <a href="#what.may.be.stored.by.caches">What May be Stored by Caches</a></li> |
---|
589 | <li><a href="#rfc.section.16.2.3">16.2.3</a> <a href="#modifications.of.the.basic.expiration.mechanism">Modifications of the Basic Expiration Mechanism</a></li> |
---|
590 | <li><a href="#rfc.section.16.2.4">16.2.4</a> <a href="#cache.revalidation.and.reload.controls">Cache Revalidation and Reload Controls</a></li> |
---|
591 | <li><a href="#rfc.section.16.2.5">16.2.5</a> <a href="#no-transform.directive">No-Transform Directive</a></li> |
---|
592 | <li><a href="#rfc.section.16.2.6">16.2.6</a> <a href="#cache.control.extensions">Cache Control Extensions</a></li> |
---|
593 | </ul> |
---|
594 | </li> |
---|
595 | <li><a href="#rfc.section.16.3">16.3</a> <a href="#header.expires">Expires</a></li> |
---|
596 | <li><a href="#rfc.section.16.4">16.4</a> <a href="#header.pragma">Pragma</a></li> |
---|
597 | <li><a href="#rfc.section.16.5">16.5</a> <a href="#header.vary">Vary</a></li> |
---|
598 | <li><a href="#rfc.section.16.6">16.6</a> <a href="#header.warning">Warning</a></li> |
---|
599 | </ul> |
---|
600 | </li> |
---|
601 | <li><a href="#rfc.section.17">17.</a> <a href="#IANA.considerations">IANA Considerations</a><ul> |
---|
602 | <li><a href="#rfc.section.17.1">17.1</a> <a href="#message.header.registration">Message Header Registration</a></li> |
---|
603 | </ul> |
---|
604 | </li> |
---|
605 | <li><a href="#rfc.section.18">18.</a> <a href="#security.considerations">Security Considerations</a></li> |
---|
606 | <li><a href="#rfc.section.19">19.</a> <a href="#ack">Acknowledgments</a></li> |
---|
607 | <li><a href="#rfc.section.20">20.</a> <a href="#rfc.references">References</a><ul> |
---|
608 | <li><a href="#rfc.section.20.1">20.1</a> <a href="#rfc.references.1">Normative References</a></li> |
---|
609 | <li><a href="#rfc.section.20.2">20.2</a> <a href="#rfc.references.2">Informative References</a></li> |
---|
610 | </ul> |
---|
611 | </li> |
---|
612 | <li><a href="#rfc.section.A">A.</a> <a href="#compatibility">Compatibility with Previous Versions</a><ul> |
---|
613 | <li><a href="#rfc.section.A.1">A.1</a> <a href="#changes.from.rfc.2068">Changes from RFC 2068</a></li> |
---|
614 | <li><a href="#rfc.section.A.2">A.2</a> <a href="#changes.from.rfc.2616">Changes from RFC 2616</a></li> |
---|
615 | </ul> |
---|
616 | </li> |
---|
617 | <li><a href="#rfc.section.B">B.</a> <a href="#change.log">Change Log (to be removed by RFC Editor before publication)</a><ul> |
---|
618 | <li><a href="#rfc.section.B.1">B.1</a> <a href="#rfc.section.B.1">Since RFC2616</a></li> |
---|
619 | <li><a href="#rfc.section.B.2">B.2</a> <a href="#rfc.section.B.2">Since draft-ietf-httpbis-p6-cache-00</a></li> |
---|
620 | <li><a href="#rfc.section.B.3">B.3</a> <a href="#rfc.section.B.3">Since draft-ietf-httpbis-p6-cache-01</a></li> |
---|
621 | <li><a href="#rfc.section.B.4">B.4</a> <a href="#changes.since.02">Since draft-ietf-httpbis-p6-cache-02</a></li> |
---|
622 | <li><a href="#rfc.section.B.5">B.5</a> <a href="#changes.since.03">Since draft-ietf-httpbis-p6-cache-03</a></li> |
---|
623 | </ul> |
---|
624 | </li> |
---|
625 | <li><a href="#rfc.index">Index</a></li> |
---|
626 | <li><a href="#rfc.authors">Authors' Addresses</a></li> |
---|
627 | <li><a href="#rfc.ipr">Intellectual Property and Copyright Statements</a></li> |
---|
628 | </ul> |
---|
629 | <div id="caching"> |
---|
630 | <h1 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a> <a href="#caching">Introduction</a></h1> |
---|
631 | <p id="rfc.section.1.p.1">HTTP is typically used for distributed information systems, where performance can be improved by the use of response caches, |
---|
632 | and includes a number of elements intended to make caching work as well as possible. Because these elements interact with |
---|
633 | each other, it is useful to describe the caching design of HTTP separately. This document defines aspects of HTTP/1.1 related |
---|
634 | to caching and reusing response messages. |
---|
635 | </p> |
---|
636 | <div id="intro.purpose"> |
---|
637 | <div id="rfc.iref.c.1"></div> |
---|
638 | <h2 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1</a> <a href="#intro.purpose">Purpose</a></h2> |
---|
639 | <p id="rfc.section.1.1.p.1">An HTTP <dfn>cache</dfn> is a local store of response messages and the subsystem that controls its message storage, retrieval, and deletion. A cache |
---|
640 | stores cacheable responses in order to reduce the response time and network bandwidth consumption on future, equivalent requests. |
---|
641 | Any client or server may include a cache, though a cache cannot be used by a server that is acting as a tunnel. |
---|
642 | </p> |
---|
643 | <p id="rfc.section.1.1.p.2">Caching would be useless if it did not significantly improve performance. The goal of caching in HTTP/1.1 is to reuse a prior |
---|
644 | response message to satisfy a current request. In some cases, the existing response can be reused without the need for a network |
---|
645 | request, reducing latency and network round-trips; we use an "expiration" mechanism for this purpose (see <a href="#expiration.model" title="Expiration Model">Section 4</a>). Even when a new request is required, it is often possible to reuse all or parts of the payload of a prior response to satisfy |
---|
646 | the request, thereby reducing network bandwidth usage; we use a "validation" mechanism for this purpose (see <a href="#validation.model" title="Validation Model">Section 5</a>). |
---|
647 | </p> |
---|
648 | <div id="rfc.iref.s.1"></div> |
---|
649 | <p id="rfc.section.1.1.p.3">A cache behaves in a "<dfn>semantically transparent</dfn>" manner, with respect to a particular response, when its use affects neither the requesting client nor the origin server, |
---|
650 | except to improve performance. When a cache is semantically transparent, the client receives exactly the same response status |
---|
651 | and payload that it would have received had its request been handled directly by the origin server. |
---|
652 | </p> |
---|
653 | <p id="rfc.section.1.1.p.4">In an ideal world, all interactions with an HTTP cache would be semantically transparent. However, for some resources, semantic |
---|
654 | transparency is not always necessary and can be effectively traded for the sake of bandwidth scaling, disconnected operation, |
---|
655 | and high availability. HTTP/1.1 allows origin servers, caches, and clients to explicitly reduce transparency when necessary. |
---|
656 | However, because non-transparent operation may confuse non-expert users and might be incompatible with certain server applications |
---|
657 | (such as those for ordering merchandise), the protocol requires that transparency be relaxed |
---|
658 | </p> |
---|
659 | <ul> |
---|
660 | <li>only by an explicit protocol-level request when relaxed by client or origin server</li> |
---|
661 | <li>only with an explicit warning to the end user when relaxed by cache or client</li> |
---|
662 | </ul> |
---|
663 | <p id="rfc.section.1.1.p.5">Therefore, HTTP/1.1 provides these important elements: </p> |
---|
664 | <ol> |
---|
665 | <li>Protocol features that provide full semantic transparency when this is required by all parties.</li> |
---|
666 | <li>Protocol features that allow an origin server or user agent to explicitly request and control non-transparent operation.</li> |
---|
667 | <li>Protocol features that allow a cache to attach warnings to responses that do not preserve the requested approximation of semantic |
---|
668 | transparency. |
---|
669 | </li> |
---|
670 | </ol> |
---|
671 | <p id="rfc.section.1.1.p.6">A basic principle is that it must be possible for the clients to detect any potential relaxation of semantic transparency. </p> |
---|
672 | <ul class="empty"> |
---|
673 | <li><b>Note:</b> The server, cache, or client implementor might be faced with design decisions not explicitly discussed in this specification. |
---|
674 | If a decision might affect semantic transparency, the implementor ought to err on the side of maintaining transparency unless |
---|
675 | a careful and complete analysis shows significant benefits in breaking transparency. |
---|
676 | </li> |
---|
677 | </ul> |
---|
678 | </div> |
---|
679 | <div id="intro.terminology"> |
---|
680 | <h2 id="rfc.section.1.2"><a href="#rfc.section.1.2">1.2</a> <a href="#intro.terminology">Terminology</a></h2> |
---|
681 | <p id="rfc.section.1.2.p.1">This specification uses a number of terms to refer to the roles played by participants in, and objects of, HTTP caching.</p> |
---|
682 | <p id="rfc.section.1.2.p.2"><span id="rfc.iref.c.2"></span> <dfn>cacheable</dfn> |
---|
683 | </p> |
---|
684 | <ul class="empty"> |
---|
685 | <li>A response is cacheable if a cache is allowed to store a copy of the response message for use in answering subsequent requests. |
---|
686 | Even when a response is cacheable, there may be additional constraints on whether a cache can use the cached copy for a particular |
---|
687 | request. |
---|
688 | </li> |
---|
689 | </ul> |
---|
690 | <p id="rfc.section.1.2.p.3"><span id="rfc.iref.f.1"></span> <dfn>first-hand</dfn> |
---|
691 | </p> |
---|
692 | <ul class="empty"> |
---|
693 | <li>A response is first-hand if it comes directly and without unnecessary delay from the origin server, perhaps via one or more |
---|
694 | proxies. A response is also first-hand if its validity has just been checked directly with the origin server. |
---|
695 | </li> |
---|
696 | </ul> |
---|
697 | <p id="rfc.section.1.2.p.4"><span id="rfc.iref.e.1"></span> <dfn>explicit expiration time</dfn> |
---|
698 | </p> |
---|
699 | <ul class="empty"> |
---|
700 | <li>The time at which the origin server intends that an entity should no longer be returned by a cache without further validation.</li> |
---|
701 | </ul> |
---|
702 | <p id="rfc.section.1.2.p.5"><span id="rfc.iref.h.1"></span> <dfn>heuristic expiration time</dfn> |
---|
703 | </p> |
---|
704 | <ul class="empty"> |
---|
705 | <li>An expiration time assigned by a cache when no explicit expiration time is available.</li> |
---|
706 | </ul> |
---|
707 | <p id="rfc.section.1.2.p.6"><span id="rfc.iref.a.1"></span> <dfn>age</dfn> |
---|
708 | </p> |
---|
709 | <ul class="empty"> |
---|
710 | <li>The age of a response is the time since it was sent by, or successfully validated with, the origin server.</li> |
---|
711 | </ul> |
---|
712 | <p id="rfc.section.1.2.p.7"><span id="rfc.iref.f.2"></span> <dfn>freshness lifetime</dfn> |
---|
713 | </p> |
---|
714 | <ul class="empty"> |
---|
715 | <li>The length of time between the generation of a response and its expiration time.</li> |
---|
716 | </ul> |
---|
717 | <p id="rfc.section.1.2.p.8"><span id="rfc.iref.f.3"></span> <dfn>fresh</dfn> |
---|
718 | </p> |
---|
719 | <ul class="empty"> |
---|
720 | <li>A response is fresh if its age has not yet exceeded its freshness lifetime.</li> |
---|
721 | </ul> |
---|
722 | <p id="rfc.section.1.2.p.9"><span id="rfc.iref.s.2"></span> <dfn>stale</dfn> |
---|
723 | </p> |
---|
724 | <ul class="empty"> |
---|
725 | <li>A response is stale if its age has passed its freshness lifetime.</li> |
---|
726 | </ul> |
---|
727 | <p id="rfc.section.1.2.p.10"><span id="rfc.iref.v.1"></span> <dfn>validator</dfn> |
---|
728 | </p> |
---|
729 | <ul class="empty"> |
---|
730 | <li>A protocol element (e.g., an entity tag or a Last-Modified time) that is used to find out whether a cache entry is an equivalent |
---|
731 | copy of an entity. |
---|
732 | </li> |
---|
733 | </ul> |
---|
734 | </div> |
---|
735 | <div id="intro.requirements"> |
---|
736 | <h2 id="rfc.section.1.3"><a href="#rfc.section.1.3">1.3</a> <a href="#intro.requirements">Requirements</a></h2> |
---|
737 | <p id="rfc.section.1.3.p.1">The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" |
---|
738 | in this document are to be interpreted as described in <a href="#RFC2119" id="rfc.xref.RFC2119.1"><cite title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</cite></a>. |
---|
739 | </p> |
---|
740 | <p id="rfc.section.1.3.p.2">An implementation is not compliant if it fails to satisfy one or more of the <em class="bcp14">MUST</em> or <em class="bcp14">REQUIRED</em> level requirements for the protocols it implements. An implementation that satisfies all the <em class="bcp14">MUST</em> or <em class="bcp14">REQUIRED</em> level and all the <em class="bcp14">SHOULD</em> level requirements for its protocols is said to be "unconditionally compliant"; one that satisfies all the <em class="bcp14">MUST</em> level requirements but not all the <em class="bcp14">SHOULD</em> level requirements for its protocols is said to be "conditionally compliant." |
---|
741 | </p> |
---|
742 | </div> |
---|
743 | </div> |
---|
744 | <div id="notation"> |
---|
745 | <h1 id="rfc.section.2"><a href="#rfc.section.2">2.</a> <a href="#notation">Notational Conventions and Generic Grammar</a></h1> |
---|
746 | <p id="rfc.section.2.p.1">This specification uses the ABNF syntax defined in <a href="p1-messaging.html#notation.abnf" title="Augmented BNF">Section 2.1</a> of <a href="#Part1" id="rfc.xref.Part1.1"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a> and the core rules defined in <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a> of <a href="#Part1" id="rfc.xref.Part1.2"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>: <span class="comment" id="abnf.dep">[<a href="#abnf.dep" class="smpl">abnf.dep</a>: ABNF syntax and basic rules will be adopted from RFC 5234, see <<a href="http://tools.ietf.org/wg/httpbis/trac/ticket/36">http://tools.ietf.org/wg/httpbis/trac/ticket/36</a>>.]</span> |
---|
747 | </p> |
---|
748 | <div id="rfc.figure.u.1"></div><pre class="inline"> <a href="#notation" class="smpl">DIGIT</a> = <DIGIT, defined in <a href="#Part1" id="rfc.xref.Part1.3"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>> |
---|
749 | <a href="#notation" class="smpl">DQUOTE</a> = <DQUOTE, defined in <a href="#Part1" id="rfc.xref.Part1.4"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>> |
---|
750 | <a href="#notation" class="smpl">SP</a> = <SP, defined in <a href="#Part1" id="rfc.xref.Part1.5"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>> |
---|
751 | </pre><div id="rfc.figure.u.2"></div><pre class="inline"> <a href="#notation" class="smpl">quoted-string</a> = <quoted-string, defined in <a href="#Part1" id="rfc.xref.Part1.6"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>> |
---|
752 | <a href="#notation" class="smpl">token</a> = <token, defined in <a href="#Part1" id="rfc.xref.Part1.7"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#basic.rules" title="Basic Rules">Section 2.2</a>> |
---|
753 | </pre><div id="abnf.dependencies"> |
---|
754 | <p id="rfc.section.2.p.4"> The ABNF rules below are defined in other parts:</p> |
---|
755 | </div> |
---|
756 | <div id="rfc.figure.u.3"></div><pre class="inline"> <a href="#abnf.dependencies" class="smpl">field-name</a> = <field-name, defined in <a href="#Part1" id="rfc.xref.Part1.8"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#message.headers" title="Message Headers">Section 4.2</a>> |
---|
757 | <a href="#abnf.dependencies" class="smpl">HTTP-date</a> = <HTTP-date, defined in <a href="#Part1" id="rfc.xref.Part1.9"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#full.date" title="Full Date">Section 3.3.1</a>> |
---|
758 | <a href="#abnf.dependencies" class="smpl">port</a> = <port, defined in <a href="#Part1" id="rfc.xref.Part1.10"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#general.syntax" title="General Syntax">Section 3.2.1</a>> |
---|
759 | <a href="#abnf.dependencies" class="smpl">pseudonym</a> = <pseudonym, defined in <a href="#Part1" id="rfc.xref.Part1.11"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#header.via" title="Via">Section 8.9</a>> |
---|
760 | <a href="#abnf.dependencies" class="smpl">uri-host</a> = <uri-host, defined in <a href="#Part1" id="rfc.xref.Part1.12"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="p1-messaging.html#general.syntax" title="General Syntax">Section 3.2.1</a>> |
---|
761 | </pre></div> |
---|
762 | <div id="caching.overview"> |
---|
763 | <h1 id="rfc.section.3"><a href="#rfc.section.3">3.</a> <a href="#caching.overview">Overview</a></h1> |
---|
764 | <div id="cache.correctness"> |
---|
765 | <h2 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1</a> <a href="#cache.correctness">Cache Correctness</a></h2> |
---|
766 | <p id="rfc.section.3.1.p.1">A correct cache <em class="bcp14">MUST</em> respond to a request with the most up-to-date response held by the cache that is appropriate to the request (see Sections <a href="#disambiguating.expiration.values" title="Disambiguating Expiration Values">4.5</a>, <a href="#disambiguating.multiple.responses" title="Disambiguating Multiple Responses">4.6</a>, and <a href="#cache.replacement" title="Cache Replacement">14</a>) which meets one of the following conditions: |
---|
767 | </p> |
---|
768 | <ol> |
---|
769 | <li>It has been checked for equivalence with what the origin server would have returned by revalidating the response with the |
---|
770 | origin server (<a href="#validation.model" title="Validation Model">Section 5</a>); |
---|
771 | </li> |
---|
772 | <li>It is "fresh enough" (see <a href="#expiration.model" title="Expiration Model">Section 4</a>). In the default case, this means it meets the least restrictive freshness requirement of the client, origin server, and |
---|
773 | cache (see <a href="#header.cache-control" id="rfc.xref.header.cache-control.1" title="Cache-Control">Section 16.2</a>); if the origin server so specifies, it is the freshness requirement of the origin server alone. If a stored response is |
---|
774 | not "fresh enough" by the most restrictive freshness requirement of both the client and the origin server, in carefully considered |
---|
775 | circumstances the cache <em class="bcp14">MAY</em> still return the response with the appropriate Warning header (see Sections <a href="#exceptions.to.the.rules.and.warnings" title="Exceptions to the Rules and Warnings">3.5</a> and <a href="#header.warning" id="rfc.xref.header.warning.1" title="Warning">16.6</a>), unless such a response is prohibited (e.g., by a "no-store" cache-directive, or by a "no-cache" cache-request-directive; |
---|
776 | see <a href="#header.cache-control" id="rfc.xref.header.cache-control.2" title="Cache-Control">Section 16.2</a>). |
---|
777 | </li> |
---|
778 | <li>It is an appropriate 304 (Not Modified), 305 (Use Proxy), or error (4xx or 5xx) response message.</li> |
---|
779 | </ol> |
---|
780 | <p id="rfc.section.3.1.p.2">If the cache can not communicate with the origin server, then a correct cache <em class="bcp14">SHOULD</em> respond as above if the response can be correctly served from the cache; if not it <em class="bcp14">MUST</em> return an error or warning indicating that there was a communication failure. |
---|
781 | </p> |
---|
782 | <p id="rfc.section.3.1.p.3">If a cache receives a response (either an entire response, or a 304 (Not Modified) response) that it would normally forward |
---|
783 | to the requesting client, and the received response is no longer fresh, the cache <em class="bcp14">SHOULD</em> forward it to the requesting client without adding a new Warning (but without removing any existing Warning headers). A cache <em class="bcp14">SHOULD NOT</em> attempt to revalidate a response simply because that response became stale in transit; this might lead to an infinite loop. |
---|
784 | A user agent that receives a stale response without a Warning <em class="bcp14">MAY</em> display a warning indication to the user. |
---|
785 | </p> |
---|
786 | </div> |
---|
787 | <div id="warnings"> |
---|
788 | <h2 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2</a> <a href="#warnings">Warnings</a></h2> |
---|
789 | <p id="rfc.section.3.2.p.1">Whenever a cache returns a response that is neither first-hand nor "fresh enough" (in the sense of condition 2 in <a href="#cache.correctness" title="Cache Correctness">Section 3.1</a>), it <em class="bcp14">MUST</em> attach a warning to that effect, using a Warning general-header. The Warning header and the currently defined warnings are |
---|
790 | described in <a href="#header.warning" id="rfc.xref.header.warning.2" title="Warning">Section 16.6</a>. The warning allows clients to take appropriate action. |
---|
791 | </p> |
---|
792 | <p id="rfc.section.3.2.p.2">Warnings <em class="bcp14">MAY</em> be used for other purposes, both cache-related and otherwise. The use of a warning, rather than an error status code, distinguish |
---|
793 | these responses from true failures. |
---|
794 | </p> |
---|
795 | <p id="rfc.section.3.2.p.3">Warnings are assigned three digit warn-codes. The first digit indicates whether the Warning <em class="bcp14">MUST</em> or <em class="bcp14">MUST NOT</em> be deleted from a stored cache entry after a successful revalidation: |
---|
796 | </p> |
---|
797 | <p id="rfc.section.3.2.p.4"></p> |
---|
798 | <dl> |
---|
799 | <dt>1xx</dt> |
---|
800 | <dd>Warnings that describe the freshness or revalidation status of the response, and so <em class="bcp14">MUST</em> be deleted after a successful revalidation. 1xx warn-codes <em class="bcp14">MAY</em> be generated by a cache only when validating a cached entry. It <em class="bcp14">MUST NOT</em> be generated by clients. |
---|
801 | </dd> |
---|
802 | <dt>2xx</dt> |
---|
803 | <dd>Warnings that describe some aspect of the entity body or entity headers that is not rectified by a revalidation (for example, |
---|
804 | a lossy compression of the entity bodies) and which <em class="bcp14">MUST NOT</em> be deleted after a successful revalidation. |
---|
805 | </dd> |
---|
806 | </dl> |
---|
807 | <p id="rfc.section.3.2.p.5">See <a href="#header.warning" id="rfc.xref.header.warning.3" title="Warning">Section 16.6</a> for the definitions of the codes themselves. |
---|
808 | </p> |
---|
809 | <p id="rfc.section.3.2.p.6">HTTP/1.0 caches will cache all Warnings in responses, without deleting the ones in the first category. Warnings in responses |
---|
810 | that are passed to HTTP/1.0 caches carry an extra warning-date field, which prevents a future HTTP/1.1 recipient from believing |
---|
811 | an erroneously cached Warning. |
---|
812 | </p> |
---|
813 | <p id="rfc.section.3.2.p.7">Warnings also carry a warning text. The text <em class="bcp14">MAY</em> be in any appropriate natural language (perhaps based on the client's Accept headers), and include an <em class="bcp14">OPTIONAL</em> indication of what character set is used. |
---|
814 | </p> |
---|
815 | <p id="rfc.section.3.2.p.8">Multiple warnings <em class="bcp14">MAY</em> be attached to a response (either by the origin server or by a cache), including multiple warnings with the same code number. |
---|
816 | For example, a server might provide the same warning with texts in both English and Basque. |
---|
817 | </p> |
---|
818 | <p id="rfc.section.3.2.p.9">When multiple warnings are attached to a response, it might not be practical or reasonable to display all of them to the user. |
---|
819 | This version of HTTP does not specify strict priority rules for deciding which warnings to display and in what order, but |
---|
820 | does suggest some heuristics. |
---|
821 | </p> |
---|
822 | </div> |
---|
823 | <div id="cache-control.mechanisms"> |
---|
824 | <h2 id="rfc.section.3.3"><a href="#rfc.section.3.3">3.3</a> <a href="#cache-control.mechanisms">Cache-control Mechanisms</a></h2> |
---|
825 | <p id="rfc.section.3.3.p.1">The basic cache mechanisms in HTTP/1.1 (server-specified expiration times and validators) are implicit directives to caches. |
---|
826 | In some cases, a server or client might need to provide explicit directives to the HTTP caches. We use the Cache-Control header |
---|
827 | for this purpose. |
---|
828 | </p> |
---|
829 | <p id="rfc.section.3.3.p.2">The Cache-Control header allows a client or server to transmit a variety of directives in either requests or responses. These |
---|
830 | directives typically override the default caching algorithms. As a general rule, if there is any apparent conflict between |
---|
831 | header values, the most restrictive interpretation is applied (that is, the one that is most likely to preserve semantic transparency). |
---|
832 | However, in some cases, cache-control directives are explicitly specified as weakening the approximation of semantic transparency |
---|
833 | (for example, "max-stale" or "public"). |
---|
834 | </p> |
---|
835 | <p id="rfc.section.3.3.p.3">The cache-control directives are described in detail in <a href="#header.cache-control" id="rfc.xref.header.cache-control.3" title="Cache-Control">Section 16.2</a>. |
---|
836 | </p> |
---|
837 | </div> |
---|
838 | <div id="explicit.ua.warnings"> |
---|
839 | <h2 id="rfc.section.3.4"><a href="#rfc.section.3.4">3.4</a> <a href="#explicit.ua.warnings">Explicit User Agent Warnings</a></h2> |
---|
840 | <p id="rfc.section.3.4.p.1">Many user agents make it possible for users to override the basic caching mechanisms. For example, the user agent might allow |
---|
841 | the user to specify that cached entities (even explicitly stale ones) are never validated. Or the user agent might habitually |
---|
842 | add "Cache-Control: max-stale=3600" to every request. The user agent <em class="bcp14">SHOULD NOT</em> default to either non-transparent behavior, or behavior that results in abnormally ineffective caching, but <em class="bcp14">MAY</em> be explicitly configured to do so by an explicit action of the user. |
---|
843 | </p> |
---|
844 | <p id="rfc.section.3.4.p.2">If the user has overridden the basic caching mechanisms, the user agent <em class="bcp14">SHOULD</em> explicitly indicate to the user whenever this results in the display of information that might not meet the server's transparency |
---|
845 | requirements (in particular, if the displayed entity is known to be stale). Since the protocol normally allows the user agent |
---|
846 | to determine if responses are stale or not, this indication need only be displayed when this actually happens. The indication |
---|
847 | need not be a dialog box; it could be an icon (for example, a picture of a rotting fish) or some other indicator. |
---|
848 | </p> |
---|
849 | <p id="rfc.section.3.4.p.3">If the user has overridden the caching mechanisms in a way that would abnormally reduce the effectiveness of caches, the user |
---|
850 | agent <em class="bcp14">SHOULD</em> continually indicate this state to the user (for example, by a display of a picture of currency in flames) so that the user |
---|
851 | does not inadvertently consume excess resources or suffer from excessive latency. |
---|
852 | </p> |
---|
853 | </div> |
---|
854 | <div id="exceptions.to.the.rules.and.warnings"> |
---|
855 | <h2 id="rfc.section.3.5"><a href="#rfc.section.3.5">3.5</a> <a href="#exceptions.to.the.rules.and.warnings">Exceptions to the Rules and Warnings</a></h2> |
---|
856 | <p id="rfc.section.3.5.p.1">In some cases, the operator of a cache <em class="bcp14">MAY</em> choose to configure it to return stale responses even when not requested by clients. This decision ought not be made lightly, |
---|
857 | but may be necessary for reasons of availability or performance, especially when the cache is poorly connected to the origin |
---|
858 | server. Whenever a cache returns a stale response, it <em class="bcp14">MUST</em> mark it as such (using a Warning header) enabling the client software to alert the user that there might be a potential problem. |
---|
859 | </p> |
---|
860 | <p id="rfc.section.3.5.p.2">It also allows the user agent to take steps to obtain a first-hand or fresh response. For this reason, a cache <em class="bcp14">SHOULD NOT</em> return a stale response if the client explicitly requests a first-hand or fresh one, unless it is impossible to comply for |
---|
861 | technical or policy reasons. |
---|
862 | </p> |
---|
863 | </div> |
---|
864 | <div id="client-controlled.behavior"> |
---|
865 | <h2 id="rfc.section.3.6"><a href="#rfc.section.3.6">3.6</a> <a href="#client-controlled.behavior">Client-controlled Behavior</a></h2> |
---|
866 | <p id="rfc.section.3.6.p.1">While the origin server (and to a lesser extent, intermediate caches, by their contribution to the age of a response) are |
---|
867 | the primary source of expiration information, in some cases the client might need to control a cache's decision about whether |
---|
868 | to return a cached response without validating it. Clients do this using several directives of the Cache-Control header. |
---|
869 | </p> |
---|
870 | <p id="rfc.section.3.6.p.2">A client's request <em class="bcp14">MAY</em> specify the maximum age it is willing to accept of an unvalidated response; specifying a value of zero forces the cache(s) |
---|
871 | to revalidate all responses. A client <em class="bcp14">MAY</em> also specify the minimum time remaining before a response expires. Both of these options increase constraints on the behavior |
---|
872 | of caches, and so cannot further relax the cache's approximation of semantic transparency. |
---|
873 | </p> |
---|
874 | <p id="rfc.section.3.6.p.3">A client <em class="bcp14">MAY</em> also specify that it will accept stale responses, up to some maximum amount of staleness. This loosens the constraints on |
---|
875 | the caches, and so might violate the origin server's specified constraints on semantic transparency, but might be necessary |
---|
876 | to support disconnected operation, or high availability in the face of poor connectivity. |
---|
877 | </p> |
---|
878 | </div> |
---|
879 | </div> |
---|
880 | <div id="expiration.model"> |
---|
881 | <h1 id="rfc.section.4"><a href="#rfc.section.4">4.</a> <a href="#expiration.model">Expiration Model</a></h1> |
---|
882 | <div id="server-specified.expiration"> |
---|
883 | <h2 id="rfc.section.4.1"><a href="#rfc.section.4.1">4.1</a> <a href="#server-specified.expiration">Server-Specified Expiration</a></h2> |
---|
884 | <p id="rfc.section.4.1.p.1">HTTP caching works best when caches can entirely avoid making requests to the origin server. The primary mechanism for avoiding |
---|
885 | requests is for an origin server to provide an explicit expiration time in the future, indicating that a response <em class="bcp14">MAY</em> be used to satisfy subsequent requests. In other words, a cache can return a fresh response without first contacting the server. |
---|
886 | </p> |
---|
887 | <p id="rfc.section.4.1.p.2">Our expectation is that servers will assign future explicit expiration times to responses in the belief that the entity is |
---|
888 | not likely to change, in a semantically significant way, before the expiration time is reached. This normally preserves semantic |
---|
889 | transparency, as long as the server's expiration times are carefully chosen. |
---|
890 | </p> |
---|
891 | <p id="rfc.section.4.1.p.3">The expiration mechanism applies only to responses taken from a cache and not to first-hand responses forwarded immediately |
---|
892 | to the requesting client. |
---|
893 | </p> |
---|
894 | <p id="rfc.section.4.1.p.4">If an origin server wishes to force a semantically transparent cache to validate every request, it <em class="bcp14">MAY</em> assign an explicit expiration time in the past. This means that the response is always stale, and so the cache <em class="bcp14">SHOULD</em> validate it before using it for subsequent requests. See <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">Section 16.2.4</a> for a more restrictive way to force revalidation. |
---|
895 | </p> |
---|
896 | <p id="rfc.section.4.1.p.5">If an origin server wishes to force any HTTP/1.1 cache, no matter how it is configured, to validate every request, it <em class="bcp14">SHOULD</em> use the "must-revalidate" cache-control directive (see <a href="#header.cache-control" id="rfc.xref.header.cache-control.4" title="Cache-Control">Section 16.2</a>). |
---|
897 | </p> |
---|
898 | <p id="rfc.section.4.1.p.6">Servers specify explicit expiration times using either the Expires header, or the max-age directive of the Cache-Control header.</p> |
---|
899 | <p id="rfc.section.4.1.p.7">An expiration time cannot be used to force a user agent to refresh its display or reload a resource; its semantics apply only |
---|
900 | to caching mechanisms, and such mechanisms need only check a resource's expiration status when a new request for that resource |
---|
901 | is initiated. See <a href="#history.lists" title="History Lists">Section 15</a> for an explanation of the difference between caches and history mechanisms. |
---|
902 | </p> |
---|
903 | </div> |
---|
904 | <div id="heuristic.expiration"> |
---|
905 | <h2 id="rfc.section.4.2"><a href="#rfc.section.4.2">4.2</a> <a href="#heuristic.expiration">Heuristic Expiration</a></h2> |
---|
906 | <p id="rfc.section.4.2.p.1">Since origin servers do not always provide explicit expiration times, HTTP caches typically assign heuristic expiration times, |
---|
907 | employing algorithms that use other header values (such as the Last-Modified time) to estimate a plausible expiration time. |
---|
908 | The HTTP/1.1 specification does not provide specific algorithms, but does impose worst-case constraints on their results. |
---|
909 | Since heuristic expiration times might compromise semantic transparency, they ought to be used cautiously, and we encourage |
---|
910 | origin servers to provide explicit expiration times as much as possible. |
---|
911 | </p> |
---|
912 | </div> |
---|
913 | <div id="age.calculations"> |
---|
914 | <h2 id="rfc.section.4.3"><a href="#rfc.section.4.3">4.3</a> <a href="#age.calculations">Age Calculations</a></h2> |
---|
915 | <p id="rfc.section.4.3.p.1">In order to know if a cached entry is fresh, a cache needs to know if its age exceeds its freshness lifetime. We discuss how |
---|
916 | to calculate the latter in <a href="#expiration.calculations" title="Expiration Calculations">Section 4.4</a>; this section describes how to calculate the age of a response or cache entry. |
---|
917 | </p> |
---|
918 | <p id="rfc.section.4.3.p.2">In this discussion, we use the term "now" to mean "the current value of the clock at the host performing the calculation." |
---|
919 | Hosts that use HTTP, but especially hosts running origin servers and caches, <em class="bcp14">SHOULD</em> use NTP <a href="#RFC1305" id="rfc.xref.RFC1305.1"><cite title="Network Time Protocol (Version 3) Specification, Implementation">[RFC1305]</cite></a> or some similar protocol to synchronize their clocks to a globally accurate time standard. |
---|
920 | </p> |
---|
921 | <p id="rfc.section.4.3.p.3">HTTP/1.1 requires origin servers to send a Date header, if possible, with every response, giving the time at which the response |
---|
922 | was generated (see <a href="p1-messaging.html#header.date" title="Date">Section 8.3</a> of <a href="#Part1" id="rfc.xref.Part1.13"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>). We use the term "date_value" to denote the value of the Date header, in a form appropriate for arithmetic operations. |
---|
923 | </p> |
---|
924 | <p id="rfc.section.4.3.p.4">HTTP/1.1 uses the Age response-header to convey the estimated age of the response message when obtained from a cache. The |
---|
925 | Age field value is the cache's estimate of the amount of time since the response was generated or revalidated by the origin |
---|
926 | server. |
---|
927 | </p> |
---|
928 | <p id="rfc.section.4.3.p.5">In essence, the Age value is the sum of the time that the response has been resident in each of the caches along the path |
---|
929 | from the origin server, plus the amount of time it has been in transit along network paths. |
---|
930 | </p> |
---|
931 | <p id="rfc.section.4.3.p.6">We use the term "age_value" to denote the value of the Age header, in a form appropriate for arithmetic operations.</p> |
---|
932 | <p id="rfc.section.4.3.p.7">A response's age can be calculated in two entirely independent ways: </p> |
---|
933 | <ol> |
---|
934 | <li>now minus date_value, if the local clock is reasonably well synchronized to the origin server's clock. If the result is negative, |
---|
935 | the result is replaced by zero. |
---|
936 | </li> |
---|
937 | <li>age_value, if all of the caches along the response path implement HTTP/1.1.</li> |
---|
938 | </ol> |
---|
939 | <p id="rfc.section.4.3.p.8">Given that we have two independent ways to compute the age of a response when it is received, we can combine these as</p> |
---|
940 | <div id="rfc.figure.u.4"></div><pre class="text"> corrected_received_age = max(now - date_value, age_value) |
---|
941 | </pre><p id="rfc.section.4.3.p.10">and as long as we have either nearly synchronized clocks or all-HTTP/1.1 paths, one gets a reliable (conservative) result.</p> |
---|
942 | <p id="rfc.section.4.3.p.11">Because of network-imposed delays, some significant interval might pass between the time that a server generates a response |
---|
943 | and the time it is received at the next outbound cache or client. If uncorrected, this delay could result in improperly low |
---|
944 | ages. |
---|
945 | </p> |
---|
946 | <p id="rfc.section.4.3.p.12">Because the request that resulted in the returned Age value must have been initiated prior to that Age value's generation, |
---|
947 | we can correct for delays imposed by the network by recording the time at which the request was initiated. Then, when an Age |
---|
948 | value is received, it <em class="bcp14">MUST</em> be interpreted relative to the time the request was initiated, not the time that the response was received. This algorithm |
---|
949 | results in conservative behavior no matter how much delay is experienced. So, we compute: |
---|
950 | </p> |
---|
951 | <div id="rfc.figure.u.5"></div><pre class="text"> corrected_initial_age = corrected_received_age |
---|
952 | + (now - request_time) |
---|
953 | </pre><p id="rfc.section.4.3.p.14">where "request_time" is the time (according to the local clock) when the request that elicited this response was sent.</p> |
---|
954 | <p id="rfc.section.4.3.p.15">Summary of age calculation algorithm, when a cache receives a response:</p> |
---|
955 | <div id="rfc.figure.u.6"></div><pre class="text"> /* |
---|
956 | * age_value |
---|
957 | * is the value of Age: header received by the cache with |
---|
958 | * this response. |
---|
959 | * date_value |
---|
960 | * is the value of the origin server's Date: header |
---|
961 | * request_time |
---|
962 | * is the (local) time when the cache made the request |
---|
963 | * that resulted in this cached response |
---|
964 | * response_time |
---|
965 | * is the (local) time when the cache received the |
---|
966 | * response |
---|
967 | * now |
---|
968 | * is the current (local) time |
---|
969 | */ |
---|
970 | |
---|
971 | apparent_age = max(0, response_time - date_value); |
---|
972 | corrected_received_age = max(apparent_age, age_value); |
---|
973 | response_delay = response_time - request_time; |
---|
974 | corrected_initial_age = corrected_received_age + response_delay; |
---|
975 | resident_time = now - response_time; |
---|
976 | current_age = corrected_initial_age + resident_time; |
---|
977 | </pre><p id="rfc.section.4.3.p.17">The current_age of a cache entry is calculated by adding the amount of time (in seconds) since the cache entry was last validated |
---|
978 | by the origin server to the corrected_initial_age. When a response is generated from a cache entry, the cache <em class="bcp14">MUST</em> include a single Age header field in the response with a value equal to the cache entry's current_age. |
---|
979 | </p> |
---|
980 | <p id="rfc.section.4.3.p.18">The presence of an Age header field in a response implies that a response is not first-hand. However, the converse is not |
---|
981 | true, since the lack of an Age header field in a response does not imply that the response is first-hand unless all caches |
---|
982 | along the request path are compliant with HTTP/1.1 (i.e., older HTTP caches did not implement the Age header field). |
---|
983 | </p> |
---|
984 | </div> |
---|
985 | <div id="expiration.calculations"> |
---|
986 | <h2 id="rfc.section.4.4"><a href="#rfc.section.4.4">4.4</a> <a href="#expiration.calculations">Expiration Calculations</a></h2> |
---|
987 | <p id="rfc.section.4.4.p.1">In order to decide whether a response is fresh or stale, we need to compare its freshness lifetime to its age. The age is |
---|
988 | calculated as described in <a href="#age.calculations" title="Age Calculations">Section 4.3</a>; this section describes how to calculate the freshness lifetime, and to determine if a response has expired. In the discussion |
---|
989 | below, the values can be represented in any form appropriate for arithmetic operations. |
---|
990 | </p> |
---|
991 | <p id="rfc.section.4.4.p.2">We use the term "expires_value" to denote the value of the Expires header. We use the term "max_age_value" to denote an appropriate |
---|
992 | value of the number of seconds carried by the "max-age" directive of the Cache-Control header in a response (see <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section 16.2.3</a>). |
---|
993 | </p> |
---|
994 | <p id="rfc.section.4.4.p.3">The max-age directive takes priority over Expires, so if max-age is present in a response, the calculation is simply:</p> |
---|
995 | <div id="rfc.figure.u.7"></div><pre class="text"> freshness_lifetime = max_age_value |
---|
996 | </pre><p id="rfc.section.4.4.p.5">Otherwise, if Expires is present in the response, the calculation is:</p> |
---|
997 | <div id="rfc.figure.u.8"></div><pre class="text"> freshness_lifetime = expires_value - date_value |
---|
998 | </pre><p id="rfc.section.4.4.p.7">Note that neither of these calculations is vulnerable to clock skew, since all of the information comes from the origin server.</p> |
---|
999 | <p id="rfc.section.4.4.p.8">If none of Expires, Cache-Control: max-age, or Cache-Control: s-maxage (see <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section 16.2.3</a>) appears in the response, and the response does not include other restrictions on caching, the cache <em class="bcp14">MAY</em> compute a freshness lifetime using a heuristic. The cache <em class="bcp14">MUST</em> attach Warning 113 to any response whose age is more than 24 hours if such warning has not already been added. |
---|
1000 | </p> |
---|
1001 | <p id="rfc.section.4.4.p.9">Also, if the response does have a Last-Modified time, the heuristic expiration value <em class="bcp14">SHOULD</em> be no more than some fraction of the interval since that time. A typical setting of this fraction might be 10%. |
---|
1002 | </p> |
---|
1003 | <p id="rfc.section.4.4.p.10">The calculation to determine if a response has expired is quite simple:</p> |
---|
1004 | <div id="rfc.figure.u.9"></div><pre class="text"> response_is_fresh = (freshness_lifetime > current_age) |
---|
1005 | </pre></div> |
---|
1006 | <div id="disambiguating.expiration.values"> |
---|
1007 | <h2 id="rfc.section.4.5"><a href="#rfc.section.4.5">4.5</a> <a href="#disambiguating.expiration.values">Disambiguating Expiration Values</a></h2> |
---|
1008 | <p id="rfc.section.4.5.p.1">Because expiration values are assigned optimistically, it is possible for two caches to contain fresh values for the same |
---|
1009 | resource that are different. |
---|
1010 | </p> |
---|
1011 | <p id="rfc.section.4.5.p.2">If a client performing a retrieval receives a non-first-hand response for a request that was already fresh in its own cache, |
---|
1012 | and the Date header in its existing cache entry is newer than the Date on the new response, then the client <em class="bcp14">MAY</em> ignore the response. If so, it <em class="bcp14">MAY</em> retry the request with a "Cache-Control: max-age=0" directive (see <a href="#header.cache-control" id="rfc.xref.header.cache-control.5" title="Cache-Control">Section 16.2</a>), to force a check with the origin server. |
---|
1013 | </p> |
---|
1014 | <p id="rfc.section.4.5.p.3">If a cache has two fresh responses for the same representation with different validators, it <em class="bcp14">MUST</em> use the one with the more recent Date header. This situation might arise because the cache is pooling responses from other |
---|
1015 | caches, or because a client has asked for a reload or a revalidation of an apparently fresh cache entry. |
---|
1016 | </p> |
---|
1017 | </div> |
---|
1018 | <div id="disambiguating.multiple.responses"> |
---|
1019 | <h2 id="rfc.section.4.6"><a href="#rfc.section.4.6">4.6</a> <a href="#disambiguating.multiple.responses">Disambiguating Multiple Responses</a></h2> |
---|
1020 | <p id="rfc.section.4.6.p.1">Because a client might be receiving responses via multiple paths, so that some responses flow through one set of caches and |
---|
1021 | other responses flow through a different set of caches, a client might receive responses in an order different from that in |
---|
1022 | which the origin server sent them. We would like the client to use the most recently generated response, even if older responses |
---|
1023 | are still apparently fresh. |
---|
1024 | </p> |
---|
1025 | <p id="rfc.section.4.6.p.2">Neither the entity tag nor the expiration value can impose an ordering on responses, since it is possible that a later response |
---|
1026 | intentionally carries an earlier expiration time. The Date values are ordered to a granularity of one second. |
---|
1027 | </p> |
---|
1028 | <p id="rfc.section.4.6.p.3">When a client tries to revalidate a cache entry, and the response it receives contains a Date header that appears to be older |
---|
1029 | than the one for the existing entry, then the client <em class="bcp14">SHOULD</em> repeat the request unconditionally, and include |
---|
1030 | </p> |
---|
1031 | <div id="rfc.figure.u.10"></div><pre class="text"> Cache-Control: max-age=0 |
---|
1032 | </pre><p id="rfc.section.4.6.p.5">to force any intermediate caches to validate their copies directly with the origin server, or</p> |
---|
1033 | <div id="rfc.figure.u.11"></div><pre class="text"> Cache-Control: no-cache |
---|
1034 | </pre><p id="rfc.section.4.6.p.7">to force any intermediate caches to obtain a new copy from the origin server.</p> |
---|
1035 | <p id="rfc.section.4.6.p.8">If the Date values are equal, then the client <em class="bcp14">MAY</em> use either response (or <em class="bcp14">MAY</em>, if it is being extremely prudent, request a new response). Servers <em class="bcp14">MUST NOT</em> depend on clients being able to choose deterministically between responses generated during the same second, if their expiration |
---|
1036 | times overlap. |
---|
1037 | </p> |
---|
1038 | </div> |
---|
1039 | </div> |
---|
1040 | <div id="validation.model"> |
---|
1041 | <h1 id="rfc.section.5"><a href="#rfc.section.5">5.</a> <a href="#validation.model">Validation Model</a></h1> |
---|
1042 | <p id="rfc.section.5.p.1">When a cache has a stale entry that it would like to use as a response to a client's request, it first has to check with the |
---|
1043 | origin server (or possibly an intermediate cache with a fresh response) to see if its cached entry is still usable. We call |
---|
1044 | this "validating" the cache entry. |
---|
1045 | </p> |
---|
1046 | <p id="rfc.section.5.p.2">HTTP's conditional request mechanism, defined in <a href="#Part4" id="rfc.xref.Part4.1"><cite title="HTTP/1.1, part 4: Conditional Requests">[Part4]</cite></a>, is used to avoid retransmitting the response payload when the cached entry is valid. When a cached response includes one |
---|
1047 | or more "cache validators," such as the field values of an ETag or Last-Modified header field, then a validating GET request <em class="bcp14">SHOULD</em> be made conditional to those field values. The server checks the conditional request's validator against the current state |
---|
1048 | of the requested resource and, if they match, the server responds with a 304 (Not Modified) status code to indicate that the |
---|
1049 | cached response can be refreshed and reused without retransmitting the response payload. If the validator does not match the |
---|
1050 | current state of the requested resource, then the server returns a full response, including payload, so that the request can |
---|
1051 | be satisfied and the cache entry supplanted without the need for an additional network round-trip. |
---|
1052 | </p> |
---|
1053 | </div> |
---|
1054 | <div id="response.cacheability"> |
---|
1055 | <h1 id="rfc.section.6"><a href="#rfc.section.6">6.</a> <a href="#response.cacheability">Response Cacheability</a></h1> |
---|
1056 | <p id="rfc.section.6.p.1">Unless specifically constrained by a cache-control (<a href="#header.cache-control" id="rfc.xref.header.cache-control.6" title="Cache-Control">Section 16.2</a>) directive, a caching system <em class="bcp14">MAY</em> always store a successful response (see <a href="#errors.or.incomplete.response.cache.behavior" title="Errors or Incomplete Response Cache Behavior">Section 10</a>) as a cache entry, <em class="bcp14">MAY</em> return it without validation if it is fresh, and <em class="bcp14">MAY</em> return it after successful validation. If there is neither a cache validator nor an explicit expiration time associated with |
---|
1057 | a response, we do not expect it to be cached, but certain caches <em class="bcp14">MAY</em> violate this expectation (for example, when little or no network connectivity is available). A client can usually detect that |
---|
1058 | such a response was taken from a cache by comparing the Date header to the current time. |
---|
1059 | </p> |
---|
1060 | <ul class="empty"> |
---|
1061 | <li><b>Note:</b> some HTTP/1.0 caches are known to violate this expectation without providing any Warning. |
---|
1062 | </li> |
---|
1063 | </ul> |
---|
1064 | <p id="rfc.section.6.p.2">However, in some cases it might be inappropriate for a cache to retain an entity, or to return it in response to a subsequent |
---|
1065 | request. This might be because absolute semantic transparency is deemed necessary by the service author, or because of security |
---|
1066 | or privacy considerations. Certain cache-control directives are therefore provided so that the server can indicate that certain |
---|
1067 | resource entities, or portions thereof, are not to be cached regardless of other considerations. |
---|
1068 | </p> |
---|
1069 | <p id="rfc.section.6.p.3">Note that <a href="p7-auth.html#header.authorization" title="Authorization">Section 4.1</a> of <a href="#Part7" id="rfc.xref.Part7.1"><cite title="HTTP/1.1, part 7: Authentication">[Part7]</cite></a> normally prevents a shared cache from saving and returning a response to a previous request if that request included an Authorization |
---|
1070 | header. |
---|
1071 | </p> |
---|
1072 | <p id="rfc.section.6.p.4">A response received with a status code of 200, 203, 206, 300, 301 or 410 <em class="bcp14">MAY</em> be stored by a cache and used in reply to a subsequent request, subject to the expiration mechanism, unless a cache-control |
---|
1073 | directive prohibits caching. However, a cache that does not support the Range and Content-Range headers <em class="bcp14">MUST NOT</em> cache 206 (Partial Content) responses. |
---|
1074 | </p> |
---|
1075 | <p id="rfc.section.6.p.5">A response received with any other status code (e.g. status codes 302 and 307) <em class="bcp14">MUST NOT</em> be returned in a reply to a subsequent request unless there are cache-control directives or another header(s) that explicitly |
---|
1076 | allow it. For example, these include the following: an Expires header (<a href="#header.expires" id="rfc.xref.header.expires.1" title="Expires">Section 16.3</a>); a "max-age", "s-maxage", "must-revalidate", "proxy-revalidate", "public" or "private" cache-control directive (<a href="#header.cache-control" id="rfc.xref.header.cache-control.7" title="Cache-Control">Section 16.2</a>). |
---|
1077 | </p> |
---|
1078 | </div> |
---|
1079 | <div id="constructing.responses.from.caches"> |
---|
1080 | <h1 id="rfc.section.7"><a href="#rfc.section.7">7.</a> <a href="#constructing.responses.from.caches">Constructing Responses From Caches</a></h1> |
---|
1081 | <p id="rfc.section.7.p.1">The purpose of an HTTP cache is to store information received in response to requests for use in responding to future requests. |
---|
1082 | In many cases, a cache simply returns the appropriate parts of a response to the requester. However, if the cache holds a |
---|
1083 | cache entry based on a previous response, it might have to combine parts of a new response with what is held in the cache |
---|
1084 | entry. |
---|
1085 | </p> |
---|
1086 | <div id="end-to-end.and.hop-by-hop.headers"> |
---|
1087 | <h2 id="rfc.section.7.1"><a href="#rfc.section.7.1">7.1</a> <a href="#end-to-end.and.hop-by-hop.headers">End-to-end and Hop-by-hop Headers</a></h2> |
---|
1088 | <p id="rfc.section.7.1.p.1">For the purpose of defining the behavior of caches and non-caching proxies, we divide HTTP headers into two categories: </p> |
---|
1089 | <ul> |
---|
1090 | <li>End-to-end headers, which are transmitted to the ultimate recipient of a request or response. End-to-end headers in responses <em class="bcp14">MUST</em> be stored as part of a cache entry and <em class="bcp14">MUST</em> be transmitted in any response formed from a cache entry. |
---|
1091 | </li> |
---|
1092 | <li>Hop-by-hop headers, which are meaningful only for a single transport-level connection, and are not stored by caches or forwarded |
---|
1093 | by proxies. |
---|
1094 | </li> |
---|
1095 | </ul> |
---|
1096 | <p id="rfc.section.7.1.p.2">The following HTTP/1.1 headers are hop-by-hop headers: </p> |
---|
1097 | <ul> |
---|
1098 | <li>Connection</li> |
---|
1099 | <li>Keep-Alive</li> |
---|
1100 | <li>Proxy-Authenticate</li> |
---|
1101 | <li>Proxy-Authorization</li> |
---|
1102 | <li>TE</li> |
---|
1103 | <li>Trailer</li> |
---|
1104 | <li>Transfer-Encoding</li> |
---|
1105 | <li>Upgrade</li> |
---|
1106 | </ul> |
---|
1107 | <p id="rfc.section.7.1.p.3">All other headers defined by HTTP/1.1 are end-to-end headers.</p> |
---|
1108 | <p id="rfc.section.7.1.p.4">Other hop-by-hop headers <em class="bcp14">MUST</em> be listed in a Connection header (<a href="p1-messaging.html#header.connection" title="Connection">Section 8.1</a> of <a href="#Part1" id="rfc.xref.Part1.14"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>). |
---|
1109 | </p> |
---|
1110 | </div> |
---|
1111 | <div id="non-modifiable.headers"> |
---|
1112 | <h2 id="rfc.section.7.2"><a href="#rfc.section.7.2">7.2</a> <a href="#non-modifiable.headers">Non-modifiable Headers</a></h2> |
---|
1113 | <p id="rfc.section.7.2.p.1">Some features of HTTP/1.1, such as Digest Authentication, depend on the value of certain end-to-end headers. A transparent |
---|
1114 | proxy <em class="bcp14">SHOULD NOT</em> modify an end-to-end header unless the definition of that header requires or specifically allows that. |
---|
1115 | </p> |
---|
1116 | <p id="rfc.section.7.2.p.2">A transparent proxy <em class="bcp14">MUST NOT</em> modify any of the following fields in a request or response, and it <em class="bcp14">MUST NOT</em> add any of these fields if not already present: |
---|
1117 | </p> |
---|
1118 | <ul> |
---|
1119 | <li>Content-Location</li> |
---|
1120 | <li>Content-MD5</li> |
---|
1121 | <li>ETag</li> |
---|
1122 | <li>Last-Modified</li> |
---|
1123 | </ul> |
---|
1124 | <p id="rfc.section.7.2.p.3">A transparent proxy <em class="bcp14">MUST NOT</em> modify any of the following fields in a response: |
---|
1125 | </p> |
---|
1126 | <ul> |
---|
1127 | <li>Expires</li> |
---|
1128 | </ul> |
---|
1129 | <p id="rfc.section.7.2.p.4">but it <em class="bcp14">MAY</em> add any of these fields if not already present. If an Expires header is added, it <em class="bcp14">MUST</em> be given a field-value identical to that of the Date header in that response. |
---|
1130 | </p> |
---|
1131 | <p id="rfc.section.7.2.p.5">A proxy <em class="bcp14">MUST NOT</em> modify or add any of the following fields in a message that contains the no-transform cache-control directive, or in any request: |
---|
1132 | </p> |
---|
1133 | <ul> |
---|
1134 | <li>Content-Encoding</li> |
---|
1135 | <li>Content-Range</li> |
---|
1136 | <li>Content-Type</li> |
---|
1137 | </ul> |
---|
1138 | <p id="rfc.section.7.2.p.6">A non-transparent proxy <em class="bcp14">MAY</em> modify or add these fields to a message that does not include no-transform, but if it does so, it <em class="bcp14">MUST</em> add a Warning 214 (Transformation applied) if one does not already appear in the message (see <a href="#header.warning" id="rfc.xref.header.warning.4" title="Warning">Section 16.6</a>). |
---|
1139 | </p> |
---|
1140 | <ul class="empty"> |
---|
1141 | <li>Warning: unnecessary modification of end-to-end headers might cause authentication failures if stronger authentication mechanisms |
---|
1142 | are introduced in later versions of HTTP. Such authentication mechanisms <em class="bcp14">MAY</em> rely on the values of header fields not listed here. |
---|
1143 | </li> |
---|
1144 | </ul> |
---|
1145 | <p id="rfc.section.7.2.p.7">The Content-Length field of a request or response is added or deleted according to the rules in <a href="p1-messaging.html#message.length" title="Message Length">Section 4.4</a> of <a href="#Part1" id="rfc.xref.Part1.15"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>. A transparent proxy <em class="bcp14">MUST</em> preserve the entity-length (<a href="p3-payload.html#entity.length" title="Entity Length">Section 4.2.2</a> of <a href="#Part3" id="rfc.xref.Part3.1"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>) of the entity-body, although it <em class="bcp14">MAY</em> change the transfer-length (<a href="p1-messaging.html#message.length" title="Message Length">Section 4.4</a> of <a href="#Part1" id="rfc.xref.Part1.16"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>). |
---|
1146 | </p> |
---|
1147 | </div> |
---|
1148 | <div id="combining.headers"> |
---|
1149 | <h2 id="rfc.section.7.3"><a href="#rfc.section.7.3">7.3</a> <a href="#combining.headers">Combining Headers</a></h2> |
---|
1150 | <p id="rfc.section.7.3.p.1">When a cache makes a validating request to a server, and the server provides a 304 (Not Modified) response or a 206 (Partial |
---|
1151 | Content) response, the cache then constructs a response to send to the requesting client. |
---|
1152 | </p> |
---|
1153 | <p id="rfc.section.7.3.p.2">If the status code is 304 (Not Modified), the cache uses the entity-body stored in the cache entry as the entity-body of this |
---|
1154 | outgoing response. If the status code is 206 (Partial Content) and the ETag or Last-Modified headers match exactly, the cache <em class="bcp14">MAY</em> combine the contents stored in the cache entry with the new contents received in the response and use the result as the entity-body |
---|
1155 | of this outgoing response, (see <a href="p5-range.html#combining.byte.ranges" title="Combining Byte Ranges">Section 5</a> of <a href="#Part5" id="rfc.xref.Part5.1"><cite title="HTTP/1.1, part 5: Range Requests and Partial Responses">[Part5]</cite></a>). |
---|
1156 | </p> |
---|
1157 | <p id="rfc.section.7.3.p.3">The end-to-end headers stored in the cache entry are used for the constructed response, except that </p> |
---|
1158 | <ul> |
---|
1159 | <li>any stored Warning headers with warn-code 1xx (see <a href="#header.warning" id="rfc.xref.header.warning.5" title="Warning">Section 16.6</a>) <em class="bcp14">MUST</em> be deleted from the cache entry and the forwarded response. |
---|
1160 | </li> |
---|
1161 | <li>any stored Warning headers with warn-code 2xx <em class="bcp14">MUST</em> be retained in the cache entry and the forwarded response. |
---|
1162 | </li> |
---|
1163 | <li>any end-to-end headers provided in the 304 or 206 response <em class="bcp14">MUST</em> replace the corresponding headers from the cache entry. |
---|
1164 | </li> |
---|
1165 | </ul> |
---|
1166 | <p id="rfc.section.7.3.p.4">Unless the cache decides to remove the cache entry, it <em class="bcp14">MUST</em> also replace the end-to-end headers stored with the cache entry with corresponding headers received in the incoming response, |
---|
1167 | except for Warning headers as described immediately above. If a header field-name in the incoming response matches more than |
---|
1168 | one header in the cache entry, all such old headers <em class="bcp14">MUST</em> be replaced. |
---|
1169 | </p> |
---|
1170 | <p id="rfc.section.7.3.p.5">In other words, the set of end-to-end headers received in the incoming response overrides all corresponding end-to-end headers |
---|
1171 | stored with the cache entry (except for stored Warning headers with warn-code 1xx, which are deleted even if not overridden). |
---|
1172 | </p> |
---|
1173 | <ul class="empty"> |
---|
1174 | <li><b>Note:</b> this rule allows an origin server to use a 304 (Not Modified) or a 206 (Partial Content) response to update any header associated |
---|
1175 | with a previous response for the same entity or sub-ranges thereof, although it might not always be meaningful or correct |
---|
1176 | to do so. This rule does not allow an origin server to use a 304 (Not Modified) or a 206 (Partial Content) response to entirely |
---|
1177 | delete a header that it had provided with a previous response. |
---|
1178 | </li> |
---|
1179 | </ul> |
---|
1180 | </div> |
---|
1181 | </div> |
---|
1182 | <div id="caching.negotiated.responses"> |
---|
1183 | <h1 id="rfc.section.8"><a href="#rfc.section.8">8.</a> <a href="#caching.negotiated.responses">Caching Negotiated Responses</a></h1> |
---|
1184 | <p id="rfc.section.8.p.1">Use of server-driven content negotiation (<a href="p3-payload.html#server-driven.negotiation" title="Server-driven Negotiation">Section 5.1</a> of <a href="#Part3" id="rfc.xref.Part3.2"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a>), as indicated by the presence of a Vary header field in a response, alters the conditions and procedure by which a cache |
---|
1185 | can use the response for subsequent requests. See <a href="#header.vary" id="rfc.xref.header.vary.1" title="Vary">Section 16.5</a> for use of the Vary header field by servers. |
---|
1186 | </p> |
---|
1187 | <p id="rfc.section.8.p.2">A server <em class="bcp14">SHOULD</em> use the Vary header field to inform a cache of what request-header fields were used to select among multiple representations |
---|
1188 | of a cacheable response subject to server-driven negotiation. The set of header fields named by the Vary field value is known |
---|
1189 | as the "selecting" request-headers. |
---|
1190 | </p> |
---|
1191 | <p id="rfc.section.8.p.3">When the cache receives a subsequent request whose Request-URI specifies one or more cache entries including a Vary header |
---|
1192 | field, the cache <em class="bcp14">MUST NOT</em> use such a cache entry to construct a response to the new request unless all of the selecting request-headers present in the |
---|
1193 | new request match the corresponding stored request-headers in the original request. |
---|
1194 | </p> |
---|
1195 | <p id="rfc.section.8.p.4">The selecting request-headers from two requests are defined to match if and only if the selecting request-headers in the first |
---|
1196 | request can be transformed to the selecting request-headers in the second request by adding or removing linear white space |
---|
1197 | (LWS) at places where this is allowed by the corresponding BNF, and/or combining multiple message-header fields with the same |
---|
1198 | field name following the rules about message headers in <a href="p1-messaging.html#message.headers" title="Message Headers">Section 4.2</a> of <a href="#Part1" id="rfc.xref.Part1.17"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>. |
---|
1199 | </p> |
---|
1200 | <p id="rfc.section.8.p.5">A Vary header field-value of "*" always fails to match and subsequent requests on that resource can only be properly interpreted |
---|
1201 | by the origin server. |
---|
1202 | </p> |
---|
1203 | <p id="rfc.section.8.p.6">If the selecting request header fields for the cached entry do not match the selecting request header fields of the new request, |
---|
1204 | then the cache <em class="bcp14">MUST NOT</em> use a cached entry to satisfy the request unless it first relays the new request to the origin server in a conditional request |
---|
1205 | and the server responds with 304 (Not Modified), including an entity tag or Content-Location that indicates the entity to |
---|
1206 | be used. |
---|
1207 | </p> |
---|
1208 | <p id="rfc.section.8.p.7">If an entity tag was assigned to a cached representation, the forwarded request <em class="bcp14">SHOULD</em> be conditional and include the entity tags in an If-None-Match header field from all its cache entries for the resource. This |
---|
1209 | conveys to the server the set of entities currently held by the cache, so that if any one of these entities matches the requested |
---|
1210 | entity, the server can use the ETag header field in its 304 (Not Modified) response to tell the cache which entry is appropriate. |
---|
1211 | If the entity-tag of the new response matches that of an existing entry, the new response <em class="bcp14">SHOULD</em> be used to update the header fields of the existing entry, and the result <em class="bcp14">MUST</em> be returned to the client. |
---|
1212 | </p> |
---|
1213 | <p id="rfc.section.8.p.8">If any of the existing cache entries contains only partial content for the associated entity, its entity-tag <em class="bcp14">SHOULD NOT</em> be included in the If-None-Match header field unless the request is for a range that would be fully satisfied by that entry. |
---|
1214 | </p> |
---|
1215 | <p id="rfc.section.8.p.9">If a cache receives a successful response whose Content-Location field matches that of an existing cache entry for the same |
---|
1216 | Request-URI, whose entity-tag differs from that of the existing entry, and whose Date is more recent than that of the existing |
---|
1217 | entry, the existing entry <em class="bcp14">SHOULD NOT</em> be returned in response to future requests and <em class="bcp14">SHOULD</em> be deleted from the cache. |
---|
1218 | </p> |
---|
1219 | </div> |
---|
1220 | <div id="shared.and.non-shared.caches"> |
---|
1221 | <h1 id="rfc.section.9"><a href="#rfc.section.9">9.</a> <a href="#shared.and.non-shared.caches">Shared and Non-Shared Caches</a></h1> |
---|
1222 | <p id="rfc.section.9.p.1">For reasons of security and privacy, it is necessary to make a distinction between "shared" and "non-shared" caches. A non-shared |
---|
1223 | cache is one that is accessible only to a single user. Accessibility in this case <em class="bcp14">SHOULD</em> be enforced by appropriate security mechanisms. All other caches are considered to be "shared." Other sections of this specification |
---|
1224 | place certain constraints on the operation of shared caches in order to prevent loss of privacy or failure of access controls. |
---|
1225 | </p> |
---|
1226 | </div> |
---|
1227 | <div id="errors.or.incomplete.response.cache.behavior"> |
---|
1228 | <h1 id="rfc.section.10"><a href="#rfc.section.10">10.</a> <a href="#errors.or.incomplete.response.cache.behavior">Errors or Incomplete Response Cache Behavior</a></h1> |
---|
1229 | <p id="rfc.section.10.p.1">A cache that receives an incomplete response (for example, with fewer bytes of data than specified in a Content-Length header) <em class="bcp14">MAY</em> store the response. However, the cache <em class="bcp14">MUST</em> treat this as a partial response. Partial responses <em class="bcp14">MAY</em> be combined as described in <a href="p5-range.html#combining.byte.ranges" title="Combining Byte Ranges">Section 5</a> of <a href="#Part5" id="rfc.xref.Part5.2"><cite title="HTTP/1.1, part 5: Range Requests and Partial Responses">[Part5]</cite></a>; the result might be a full response or might still be partial. A cache <em class="bcp14">MUST NOT</em> return a partial response to a client without explicitly marking it as such, using the 206 (Partial Content) status code. |
---|
1230 | A cache <em class="bcp14">MUST NOT</em> return a partial response using a status code of 200 (OK). |
---|
1231 | </p> |
---|
1232 | <p id="rfc.section.10.p.2">If a cache receives a 5xx response while attempting to revalidate an entry, it <em class="bcp14">MAY</em> either forward this response to the requesting client, or act as if the server failed to respond. In the latter case, it <em class="bcp14">MAY</em> return a previously received response unless the cached entry includes the "must-revalidate" cache-control directive (see <a href="#header.cache-control" id="rfc.xref.header.cache-control.8" title="Cache-Control">Section 16.2</a>). |
---|
1233 | </p> |
---|
1234 | </div> |
---|
1235 | <div id="side.effects.of.get.and.head"> |
---|
1236 | <h1 id="rfc.section.11"><a href="#rfc.section.11">11.</a> <a href="#side.effects.of.get.and.head">Side Effects of GET and HEAD</a></h1> |
---|
1237 | <p id="rfc.section.11.p.1">Unless the origin server explicitly prohibits the caching of their responses, the application of GET and HEAD methods to any |
---|
1238 | resources <em class="bcp14">SHOULD NOT</em> have side effects that would lead to erroneous behavior if these responses are taken from a cache. They <em class="bcp14">MAY</em> still have side effects, but a cache is not required to consider such side effects in its caching decisions. Caches are always |
---|
1239 | expected to observe an origin server's explicit restrictions on caching. |
---|
1240 | </p> |
---|
1241 | <p id="rfc.section.11.p.2">We note one exception to this rule: since some applications have traditionally used GET and HEAD requests with URLs containing |
---|
1242 | a query part to perform operations with significant side effects, caches <em class="bcp14">MUST NOT</em> treat responses to such URIs as fresh unless the server provides an explicit expiration time. This specifically means that |
---|
1243 | responses from HTTP/1.0 servers for such URIs <em class="bcp14">SHOULD NOT</em> be taken from a cache. See <a href="p2-semantics.html#safe.methods" title="Safe Methods">Section 8.1.1</a> of <a href="#Part2" id="rfc.xref.Part2.1"><cite title="HTTP/1.1, part 2: Message Semantics">[Part2]</cite></a> for related information. |
---|
1244 | </p> |
---|
1245 | </div> |
---|
1246 | <div id="invalidation.after.updates.or.deletions"> |
---|
1247 | <h1 id="rfc.section.12"><a href="#rfc.section.12">12.</a> <a href="#invalidation.after.updates.or.deletions">Invalidation After Updates or Deletions</a></h1> |
---|
1248 | <p id="rfc.section.12.p.1">The effect of certain methods performed on a resource at the origin server might cause one or more existing cache entries |
---|
1249 | to become non-transparently invalid. That is, although they might continue to be "fresh," they do not accurately reflect what |
---|
1250 | the origin server would return for a new request on that resource. |
---|
1251 | </p> |
---|
1252 | <p id="rfc.section.12.p.2">There is no way for HTTP to guarantee that all such cache entries are marked invalid. For example, the request that caused |
---|
1253 | the change at the origin server might not have gone through the proxy where a cache entry is stored. However, several rules |
---|
1254 | help reduce the likelihood of erroneous behavior. |
---|
1255 | </p> |
---|
1256 | <p id="rfc.section.12.p.3">In this section, the phrase "invalidate an entity" means that the cache will either remove all instances of that entity from |
---|
1257 | its storage, or will mark these as "invalid" and in need of a mandatory revalidation before they can be returned in response |
---|
1258 | to a subsequent request. |
---|
1259 | </p> |
---|
1260 | <p id="rfc.section.12.p.4">Some HTTP methods <em class="bcp14">MUST</em> cause a cache to invalidate an entity. This is either the entity referred to by the Request-URI, or by the Location or Content-Location |
---|
1261 | headers (if present). These methods are: |
---|
1262 | </p> |
---|
1263 | <ul> |
---|
1264 | <li>PUT</li> |
---|
1265 | <li>DELETE</li> |
---|
1266 | <li>POST</li> |
---|
1267 | </ul> |
---|
1268 | <p id="rfc.section.12.p.5">An invalidation based on the URI in a Location or Content-Location header <em class="bcp14">MUST NOT</em> be performed if the host part of that URI differs from the host part in the Request-URI. This helps prevent denial of service |
---|
1269 | attacks. |
---|
1270 | </p> |
---|
1271 | <p id="rfc.section.12.p.6">A cache that passes through requests for methods it does not understand <em class="bcp14">SHOULD</em> invalidate any entities referred to by the Request-URI. |
---|
1272 | </p> |
---|
1273 | </div> |
---|
1274 | <div id="write-through.mandatory"> |
---|
1275 | <h1 id="rfc.section.13"><a href="#rfc.section.13">13.</a> <a href="#write-through.mandatory">Write-Through Mandatory</a></h1> |
---|
1276 | <p id="rfc.section.13.p.1">All methods that might be expected to cause modifications to the origin server's resources <em class="bcp14">MUST</em> be written through to the origin server. This currently includes all methods except for GET and HEAD. A cache <em class="bcp14">MUST NOT</em> reply to such a request from a client before having transmitted the request to the inbound server, and having received a corresponding |
---|
1277 | response from the inbound server. This does not prevent a proxy cache from sending a 100 (Continue) response before the inbound |
---|
1278 | server has sent its final reply. |
---|
1279 | </p> |
---|
1280 | <p id="rfc.section.13.p.2">The alternative (known as "write-back" or "copy-back" caching) is not allowed in HTTP/1.1, due to the difficulty of providing |
---|
1281 | consistent updates and the problems arising from server, cache, or network failure prior to write-back. |
---|
1282 | </p> |
---|
1283 | </div> |
---|
1284 | <div id="cache.replacement"> |
---|
1285 | <h1 id="rfc.section.14"><a href="#rfc.section.14">14.</a> <a href="#cache.replacement">Cache Replacement</a></h1> |
---|
1286 | <p id="rfc.section.14.p.1">If a new cacheable (see Sections <a href="#what.may.be.stored.by.caches" title="What May be Stored by Caches">16.2.2</a>, <a href="#disambiguating.expiration.values" title="Disambiguating Expiration Values">4.5</a>, <a href="#disambiguating.multiple.responses" title="Disambiguating Multiple Responses">4.6</a> and <a href="#errors.or.incomplete.response.cache.behavior" title="Errors or Incomplete Response Cache Behavior">10</a>) response is received from a resource while any existing responses for the same resource are cached, the cache <em class="bcp14">SHOULD</em> use the new response to reply to the current request. It <em class="bcp14">MAY</em> insert it into cache storage and <em class="bcp14">MAY</em>, if it meets all other requirements, use it to respond to any future requests that would previously have caused the old response |
---|
1287 | to be returned. If it inserts the new response into cache storage the rules in <a href="#combining.headers" title="Combining Headers">Section 7.3</a> apply. |
---|
1288 | </p> |
---|
1289 | <ul class="empty"> |
---|
1290 | <li><b>Note:</b> a new response that has an older Date header value than existing cached responses is not cacheable. |
---|
1291 | </li> |
---|
1292 | </ul> |
---|
1293 | </div> |
---|
1294 | <div id="history.lists"> |
---|
1295 | <h1 id="rfc.section.15"><a href="#rfc.section.15">15.</a> <a href="#history.lists">History Lists</a></h1> |
---|
1296 | <p id="rfc.section.15.p.1">User agents often have history mechanisms, such as "Back" buttons and history lists, which can be used to redisplay an entity |
---|
1297 | retrieved earlier in a session. |
---|
1298 | </p> |
---|
1299 | <p id="rfc.section.15.p.2">History mechanisms and caches are different. In particular history mechanisms <em class="bcp14">SHOULD NOT</em> try to show a semantically transparent view of the current state of a resource. Rather, a history mechanism is meant to show |
---|
1300 | exactly what the user saw at the time when the resource was retrieved. |
---|
1301 | </p> |
---|
1302 | <p id="rfc.section.15.p.3">By default, an expiration time does not apply to history mechanisms. If the entity is still in storage, a history mechanism <em class="bcp14">SHOULD</em> display it even if the entity has expired, unless the user has specifically configured the agent to refresh expired history |
---|
1303 | documents. |
---|
1304 | </p> |
---|
1305 | <p id="rfc.section.15.p.4">This is not to be construed to prohibit the history mechanism from telling the user that a view might be stale. </p> |
---|
1306 | <ul class="empty"> |
---|
1307 | <li><b>Note:</b> if history list mechanisms unnecessarily prevent users from viewing stale resources, this will tend to force service authors |
---|
1308 | to avoid using HTTP expiration controls and cache controls when they would otherwise like to. Service authors may consider |
---|
1309 | it important that users not be presented with error messages or warning messages when they use navigation controls (such as |
---|
1310 | BACK) to view previously fetched resources. Even though sometimes such resources ought not be cached, or ought to expire quickly, |
---|
1311 | user interface considerations may force service authors to resort to other means of preventing caching (e.g. "once-only" URLs) |
---|
1312 | in order not to suffer the effects of improperly functioning history mechanisms. |
---|
1313 | </li> |
---|
1314 | </ul> |
---|
1315 | </div> |
---|
1316 | <div id="header.fields"> |
---|
1317 | <h1 id="rfc.section.16"><a href="#rfc.section.16">16.</a> <a href="#header.fields">Header Field Definitions</a></h1> |
---|
1318 | <p id="rfc.section.16.p.1">This section defines the syntax and semantics of HTTP/1.1 header fields related to caching.</p> |
---|
1319 | <p id="rfc.section.16.p.2">For entity-header fields, both sender and recipient refer to either the client or the server, depending on who sends and who |
---|
1320 | receives the entity. |
---|
1321 | </p> |
---|
1322 | <div id="header.age"> |
---|
1323 | <div id="rfc.iref.a.2"></div> |
---|
1324 | <div id="rfc.iref.h.2"></div> |
---|
1325 | <h2 id="rfc.section.16.1"><a href="#rfc.section.16.1">16.1</a> <a href="#header.age">Age</a></h2> |
---|
1326 | <p id="rfc.section.16.1.p.1">The Age response-header field conveys the sender's estimate of the amount of time since the response (or its revalidation) |
---|
1327 | was generated at the origin server. A cached response is "fresh" if its age does not exceed its freshness lifetime. Age values |
---|
1328 | are calculated as specified in <a href="#age.calculations" title="Age Calculations">Section 4.3</a>. |
---|
1329 | </p> |
---|
1330 | <div id="rfc.figure.u.12"></div><pre class="inline"><span id="rfc.iref.g.1"></span><span id="rfc.iref.g.2"></span> <a href="#header.age" class="smpl">Age</a> = "Age" ":" <a href="#header.age" class="smpl">age-value</a> |
---|
1331 | <a href="#header.age" class="smpl">age-value</a> = <a href="#rule.delta-seconds" class="smpl">delta-seconds</a> |
---|
1332 | </pre><div id="rule.delta-seconds"> |
---|
1333 | <p id="rfc.section.16.1.p.3"> Age values are non-negative decimal integers, representing time in seconds.</p> |
---|
1334 | </div> |
---|
1335 | <div id="rfc.figure.u.13"></div><pre class="inline"><span id="rfc.iref.g.3"></span> <a href="#rule.delta-seconds" class="smpl">delta-seconds</a> = 1*<a href="#notation" class="smpl">DIGIT</a> |
---|
1336 | </pre><p id="rfc.section.16.1.p.5">If a cache receives a value larger than the largest positive integer it can represent, or if any of its age calculations overflows, |
---|
1337 | it <em class="bcp14">MUST</em> transmit an Age header with a value of 2147483648 (2<sup>31</sup>). An HTTP/1.1 server that includes a cache <em class="bcp14">MUST</em> include an Age header field in every response generated from its own cache. Caches <em class="bcp14">SHOULD</em> use an arithmetic type of at least 31 bits of range. |
---|
1338 | </p> |
---|
1339 | </div> |
---|
1340 | <div id="header.cache-control"> |
---|
1341 | <div id="rfc.iref.c.3"></div> |
---|
1342 | <div id="rfc.iref.h.3"></div> |
---|
1343 | <h2 id="rfc.section.16.2"><a href="#rfc.section.16.2">16.2</a> <a href="#header.cache-control">Cache-Control</a></h2> |
---|
1344 | <p id="rfc.section.16.2.p.1">The Cache-Control general-header field is used to specify directives that <em class="bcp14">MUST</em> be obeyed by all caching mechanisms along the request/response chain. The directives specify behavior intended to prevent |
---|
1345 | caches from adversely interfering with the request or response. These directives typically override the default caching algorithms. |
---|
1346 | Cache directives are unidirectional in that the presence of a directive in a request does not imply that the same directive |
---|
1347 | is to be given in the response. |
---|
1348 | </p> |
---|
1349 | <ul class="empty"> |
---|
1350 | <li>Note that HTTP/1.0 caches might not implement Cache-Control and might only implement Pragma: no-cache (see <a href="#header.pragma" id="rfc.xref.header.pragma.1" title="Pragma">Section 16.4</a>). |
---|
1351 | </li> |
---|
1352 | </ul> |
---|
1353 | <p id="rfc.section.16.2.p.2">Cache directives <em class="bcp14">MUST</em> be passed through by a proxy or gateway application, regardless of their significance to that application, since the directives |
---|
1354 | might be applicable to all recipients along the request/response chain. It is not possible to specify a cache-directive for |
---|
1355 | a specific cache. |
---|
1356 | </p> |
---|
1357 | <div id="rfc.figure.u.14"></div><pre class="inline"><span id="rfc.iref.g.4"></span><span id="rfc.iref.g.5"></span><span id="rfc.iref.g.6"></span><span id="rfc.iref.g.7"></span><span id="rfc.iref.g.8"></span> <a href="#header.cache-control" class="smpl">Cache-Control</a> = "Cache-Control" ":" 1#<a href="#header.cache-control" class="smpl">cache-directive</a> |
---|
1358 | |
---|
1359 | <a href="#header.cache-control" class="smpl">cache-directive</a> = <a href="#header.cache-control" class="smpl">cache-request-directive</a> |
---|
1360 | | <a href="#header.cache-control" class="smpl">cache-response-directive</a> |
---|
1361 | |
---|
1362 | <a href="#header.cache-control" class="smpl">cache-request-directive</a> = |
---|
1363 | "no-cache" ; <a href="#what.is.cacheable" title="What is Cacheable">Section 16.2.1</a> |
---|
1364 | | "no-store" ; <a href="#what.may.be.stored.by.caches" title="What May be Stored by Caches">Section 16.2.2</a> |
---|
1365 | | "max-age" "=" <a href="#rule.delta-seconds" class="smpl">delta-seconds</a> ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section 16.2.3</a>, <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">16.2.4</a> |
---|
1366 | | "max-stale" [ "=" <a href="#rule.delta-seconds" class="smpl">delta-seconds</a> ] ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section 16.2.3</a> |
---|
1367 | | "min-fresh" "=" <a href="#rule.delta-seconds" class="smpl">delta-seconds</a> ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section 16.2.3</a> |
---|
1368 | | "no-transform" ; <a href="#no-transform.directive" title="No-Transform Directive">Section 16.2.5</a> |
---|
1369 | | "only-if-cached" ; <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">Section 16.2.4</a> |
---|
1370 | | <a href="#header.cache-control" class="smpl">cache-extension</a> ; <a href="#cache.control.extensions" title="Cache Control Extensions">Section 16.2.6</a> |
---|
1371 | |
---|
1372 | <a href="#header.cache-control" class="smpl">cache-response-directive</a> = |
---|
1373 | "public" ; <a href="#what.is.cacheable" title="What is Cacheable">Section 16.2.1</a> |
---|
1374 | | "private" [ "=" <a href="#notation" class="smpl">DQUOTE</a> 1#<a href="#abnf.dependencies" class="smpl">field-name</a> <a href="#notation" class="smpl">DQUOTE</a> ] ; <a href="#what.is.cacheable" title="What is Cacheable">Section 16.2.1</a> |
---|
1375 | | "no-cache" [ "=" <a href="#notation" class="smpl">DQUOTE</a> 1#<a href="#abnf.dependencies" class="smpl">field-name</a> <a href="#notation" class="smpl">DQUOTE</a> ] ; <a href="#what.is.cacheable" title="What is Cacheable">Section 16.2.1</a> |
---|
1376 | | "no-store" ; <a href="#what.may.be.stored.by.caches" title="What May be Stored by Caches">Section 16.2.2</a> |
---|
1377 | | "no-transform" ; <a href="#no-transform.directive" title="No-Transform Directive">Section 16.2.5</a> |
---|
1378 | | "must-revalidate" ; <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">Section 16.2.4</a> |
---|
1379 | | "proxy-revalidate" ; <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">Section 16.2.4</a> |
---|
1380 | | "max-age" "=" <a href="#rule.delta-seconds" class="smpl">delta-seconds</a> ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section 16.2.3</a> |
---|
1381 | | "s-maxage" "=" <a href="#rule.delta-seconds" class="smpl">delta-seconds</a> ; <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section 16.2.3</a> |
---|
1382 | | <a href="#header.cache-control" class="smpl">cache-extension</a> ; <a href="#cache.control.extensions" title="Cache Control Extensions">Section 16.2.6</a> |
---|
1383 | |
---|
1384 | <a href="#header.cache-control" class="smpl">cache-extension</a> = <a href="#notation" class="smpl">token</a> [ "=" ( <a href="#notation" class="smpl">token</a> | <a href="#notation" class="smpl">quoted-string</a> ) ] |
---|
1385 | </pre><p id="rfc.section.16.2.p.4">When a directive appears without any 1#field-name parameter, the directive applies to the entire request or response. When |
---|
1386 | such a directive appears with a 1#field-name parameter, it applies only to the named field or fields, and not to the rest |
---|
1387 | of the request or response. This mechanism supports extensibility; implementations of future versions of HTTP might apply |
---|
1388 | these directives to header fields not defined in HTTP/1.1. |
---|
1389 | </p> |
---|
1390 | <p id="rfc.section.16.2.p.5">The cache-control directives can be broken down into these general categories: </p> |
---|
1391 | <ul> |
---|
1392 | <li>Restrictions on what are cacheable; these may only be imposed by the origin server.</li> |
---|
1393 | <li>Restrictions on what may be stored by a cache; these may be imposed by either the origin server or the user agent.</li> |
---|
1394 | <li>Modifications of the basic expiration mechanism; these may be imposed by either the origin server or the user agent.</li> |
---|
1395 | <li>Controls over cache revalidation and reload; these may only be imposed by a user agent.</li> |
---|
1396 | <li>Control over transformation of entities.</li> |
---|
1397 | <li>Extensions to the caching system.</li> |
---|
1398 | </ul> |
---|
1399 | <div id="what.is.cacheable"> |
---|
1400 | <h3 id="rfc.section.16.2.1"><a href="#rfc.section.16.2.1">16.2.1</a> <a href="#what.is.cacheable">What is Cacheable</a></h3> |
---|
1401 | <p id="rfc.section.16.2.1.p.1">By default, a response is cacheable if the requirements of the request method, request header fields, and the response status |
---|
1402 | indicate that it is cacheable. <a href="#response.cacheability" title="Response Cacheability">Section 6</a> summarizes these defaults for cacheability. The following Cache-Control response directives allow an origin server to override |
---|
1403 | the default cacheability of a response: |
---|
1404 | </p> |
---|
1405 | <p id="rfc.section.16.2.1.p.2"><span id="rfc.iref.c.4"></span> <span id="rfc.iref.p.1"></span> public |
---|
1406 | </p> |
---|
1407 | <ul class="empty"> |
---|
1408 | <li>Indicates that the response <em class="bcp14">MAY</em> be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non-shared cache. (See also |
---|
1409 | Authorization, <a href="p7-auth.html#header.authorization" title="Authorization">Section 4.1</a> of <a href="#Part7" id="rfc.xref.Part7.2"><cite title="HTTP/1.1, part 7: Authentication">[Part7]</cite></a>, for additional details.) |
---|
1410 | </li> |
---|
1411 | </ul> |
---|
1412 | <p id="rfc.section.16.2.1.p.3"><span id="rfc.iref.c.5"></span> <span id="rfc.iref.p.2"></span> private |
---|
1413 | </p> |
---|
1414 | <ul class="empty"> |
---|
1415 | <li>Indicates that all or part of the response message is intended for a single user and <em class="bcp14">MUST NOT</em> be cached by a shared cache. This allows an origin server to state that the specified parts of the response are intended for |
---|
1416 | only one user and are not a valid response for requests by other users. A private (non-shared) cache <em class="bcp14">MAY</em> cache the response. |
---|
1417 | </li> |
---|
1418 | <li><b>Note:</b> This usage of the word private only controls where the response may be cached, and cannot ensure the privacy of the message |
---|
1419 | content. |
---|
1420 | </li> |
---|
1421 | </ul> |
---|
1422 | <p id="rfc.section.16.2.1.p.4"><span id="rfc.iref.c.6"></span> <span id="rfc.iref.n.1"></span> no-cache |
---|
1423 | </p> |
---|
1424 | <ul class="empty"> |
---|
1425 | <li>If the no-cache directive does not specify a field-name, then a cache <em class="bcp14">MUST NOT</em> use the response to satisfy a subsequent request without successful revalidation with the origin server. This allows an origin |
---|
1426 | server to prevent caching even by caches that have been configured to return stale responses to client requests. |
---|
1427 | </li> |
---|
1428 | <li>If the no-cache directive does specify one or more field-names, then a cache <em class="bcp14">MAY</em> use the response to satisfy a subsequent request, subject to any other restrictions on caching. However, the specified field-name(s) <em class="bcp14">MUST NOT</em> be sent in the response to a subsequent request without successful revalidation with the origin server. This allows an origin |
---|
1429 | server to prevent the re-use of certain header fields in a response, while still allowing caching of the rest of the response. |
---|
1430 | <ul class="empty"> |
---|
1431 | <li><b>Note:</b> Most HTTP/1.0 caches will not recognize or obey this directive. |
---|
1432 | </li> |
---|
1433 | </ul> |
---|
1434 | </li> |
---|
1435 | </ul> |
---|
1436 | </div> |
---|
1437 | <div id="what.may.be.stored.by.caches"> |
---|
1438 | <h3 id="rfc.section.16.2.2"><a href="#rfc.section.16.2.2">16.2.2</a> <a href="#what.may.be.stored.by.caches">What May be Stored by Caches</a></h3> |
---|
1439 | <p id="rfc.section.16.2.2.p.1"><span id="rfc.iref.c.7"></span> <span id="rfc.iref.n.2"></span> no-store |
---|
1440 | </p> |
---|
1441 | <ul class="empty"> |
---|
1442 | <li>The purpose of the no-store directive is to prevent the inadvertent release or retention of sensitive information (for example, |
---|
1443 | on backup tapes). The no-store directive applies to the entire message, and <em class="bcp14">MAY</em> be sent either in a response or in a request. If sent in a request, a cache <em class="bcp14">MUST NOT</em> store any part of either this request or any response to it. If sent in a response, a cache <em class="bcp14">MUST NOT</em> store any part of either this response or the request that elicited it. This directive applies to both non-shared and shared |
---|
1444 | caches. "<em class="bcp14">MUST NOT</em> store" in this context means that the cache <em class="bcp14">MUST NOT</em> intentionally store the information in non-volatile storage, and <em class="bcp14">MUST</em> make a best-effort attempt to remove the information from volatile storage as promptly as possible after forwarding it. |
---|
1445 | </li> |
---|
1446 | <li>Even when this directive is associated with a response, users might explicitly store such a response outside of the caching |
---|
1447 | system (e.g., with a "Save As" dialog). History buffers <em class="bcp14">MAY</em> store such responses as part of their normal operation. |
---|
1448 | </li> |
---|
1449 | <li>The purpose of this directive is to meet the stated requirements of certain users and service authors who are concerned about |
---|
1450 | accidental releases of information via unanticipated accesses to cache data structures. While the use of this directive might |
---|
1451 | improve privacy in some cases, we caution that it is NOT in any way a reliable or sufficient mechanism for ensuring privacy. |
---|
1452 | In particular, malicious or compromised caches might not recognize or obey this directive, and communications networks might |
---|
1453 | be vulnerable to eavesdropping. |
---|
1454 | </li> |
---|
1455 | </ul> |
---|
1456 | </div> |
---|
1457 | <div id="modifications.of.the.basic.expiration.mechanism"> |
---|
1458 | <h3 id="rfc.section.16.2.3"><a href="#rfc.section.16.2.3">16.2.3</a> <a href="#modifications.of.the.basic.expiration.mechanism">Modifications of the Basic Expiration Mechanism</a></h3> |
---|
1459 | <p id="rfc.section.16.2.3.p.1">The expiration time of an entity <em class="bcp14">MAY</em> be specified by the origin server using the Expires header (see <a href="#header.expires" id="rfc.xref.header.expires.2" title="Expires">Section 16.3</a>). Alternatively, it <em class="bcp14">MAY</em> be specified using the max-age directive in a response. When the max-age cache-control directive is present in a cached response, |
---|
1460 | the response is stale if its current age is greater than the age value given (in seconds) at the time of a new request for |
---|
1461 | that resource. The max-age directive on a response implies that the response is cacheable (i.e., "public") unless some other, |
---|
1462 | more restrictive cache directive is also present. |
---|
1463 | </p> |
---|
1464 | <p id="rfc.section.16.2.3.p.2">If a response includes both an Expires header and a max-age directive, the max-age directive overrides the Expires header, |
---|
1465 | even if the Expires header is more restrictive. This rule allows an origin server to provide, for a given response, a longer |
---|
1466 | expiration time to an HTTP/1.1 (or later) cache than to an HTTP/1.0 cache. This might be useful if certain HTTP/1.0 caches |
---|
1467 | improperly calculate ages or expiration times, perhaps due to desynchronized clocks. |
---|
1468 | </p> |
---|
1469 | <p id="rfc.section.16.2.3.p.3">Many HTTP/1.0 cache implementations will treat an Expires value that is less than or equal to the response Date value as being |
---|
1470 | equivalent to the Cache-Control response directive "no-cache". If an HTTP/1.1 cache receives such a response, and the response |
---|
1471 | does not include a Cache-Control header field, it <em class="bcp14">SHOULD</em> consider the response to be non-cacheable in order to retain compatibility with HTTP/1.0 servers. |
---|
1472 | </p> |
---|
1473 | <ul class="empty"> |
---|
1474 | <li><b>Note:</b> An origin server might wish to use a relatively new HTTP cache control feature, such as the "private" directive, on a network |
---|
1475 | including older caches that do not understand that feature. The origin server will need to combine the new feature with an |
---|
1476 | Expires field whose value is less than or equal to the Date value. This will prevent older caches from improperly caching |
---|
1477 | the response. |
---|
1478 | </li> |
---|
1479 | </ul> |
---|
1480 | <p id="rfc.section.16.2.3.p.4"><span id="rfc.iref.c.8"></span> <span id="rfc.iref.s.3"></span> s-maxage |
---|
1481 | </p> |
---|
1482 | <ul class="empty"> |
---|
1483 | <li>If a response includes an s-maxage directive, then for a shared cache (but not for a private cache), the maximum age specified |
---|
1484 | by this directive overrides the maximum age specified by either the max-age directive or the Expires header. The s-maxage |
---|
1485 | directive also implies the semantics of the proxy-revalidate directive (see <a href="#cache.revalidation.and.reload.controls" title="Cache Revalidation and Reload Controls">Section 16.2.4</a>), i.e., that the shared cache must not use the entry after it becomes stale to respond to a subsequent request without first |
---|
1486 | revalidating it with the origin server. The s-maxage directive is always ignored by a private cache. |
---|
1487 | </li> |
---|
1488 | </ul> |
---|
1489 | <p id="rfc.section.16.2.3.p.5">Note that most older caches, not compliant with this specification, do not implement any cache-control directives. An origin |
---|
1490 | server wishing to use a cache-control directive that restricts, but does not prevent, caching by an HTTP/1.1-compliant cache <em class="bcp14">MAY</em> exploit the requirement that the max-age directive overrides the Expires header, and the fact that pre-HTTP/1.1-compliant |
---|
1491 | caches do not observe the max-age directive. |
---|
1492 | </p> |
---|
1493 | <p id="rfc.section.16.2.3.p.6">Other directives allow a user agent to modify the basic expiration mechanism. These directives <em class="bcp14">MAY</em> be specified on a request: |
---|
1494 | </p> |
---|
1495 | <p id="rfc.section.16.2.3.p.7"><span id="rfc.iref.c.9"></span> <span id="rfc.iref.m.1"></span> max-age |
---|
1496 | </p> |
---|
1497 | <ul class="empty"> |
---|
1498 | <li>Indicates that the client is willing to accept a response whose age is no greater than the specified time in seconds. Unless |
---|
1499 | max-stale directive is also included, the client is not willing to accept a stale response. |
---|
1500 | </li> |
---|
1501 | </ul> |
---|
1502 | <p id="rfc.section.16.2.3.p.8"><span id="rfc.iref.c.10"></span> <span id="rfc.iref.m.2"></span> min-fresh |
---|
1503 | </p> |
---|
1504 | <ul class="empty"> |
---|
1505 | <li>Indicates that the client is willing to accept a response whose freshness lifetime is no less than its current age plus the |
---|
1506 | specified time in seconds. That is, the client wants a response that will still be fresh for at least the specified number |
---|
1507 | of seconds. |
---|
1508 | </li> |
---|
1509 | </ul> |
---|
1510 | <p id="rfc.section.16.2.3.p.9"><span id="rfc.iref.c.11"></span> <span id="rfc.iref.m.3"></span> max-stale |
---|
1511 | </p> |
---|
1512 | <ul class="empty"> |
---|
1513 | <li>Indicates that the client is willing to accept a response that has exceeded its expiration time. If max-stale is assigned |
---|
1514 | a value, then the client is willing to accept a response that has exceeded its expiration time by no more than the specified |
---|
1515 | number of seconds. If no value is assigned to max-stale, then the client is willing to accept a stale response of any age. |
---|
1516 | </li> |
---|
1517 | </ul> |
---|
1518 | <p id="rfc.section.16.2.3.p.10">If a cache returns a stale response, either because of a max-stale directive on a request, or because the cache is configured |
---|
1519 | to override the expiration time of a response, the cache <em class="bcp14">MUST</em> attach a Warning header to the stale response, using Warning 110 (Response is stale). |
---|
1520 | </p> |
---|
1521 | <p id="rfc.section.16.2.3.p.11">A cache <em class="bcp14">MAY</em> be configured to return stale responses without validation, but only if this does not conflict with any "MUST"-level requirements |
---|
1522 | concerning cache validation (e.g., a "must-revalidate" cache-control directive). |
---|
1523 | </p> |
---|
1524 | <p id="rfc.section.16.2.3.p.12">If both the new request and the cached entry include "max-age" directives, then the lesser of the two values is used for determining |
---|
1525 | the freshness of the cached entry for that request. |
---|
1526 | </p> |
---|
1527 | </div> |
---|
1528 | <div id="cache.revalidation.and.reload.controls"> |
---|
1529 | <h3 id="rfc.section.16.2.4"><a href="#rfc.section.16.2.4">16.2.4</a> <a href="#cache.revalidation.and.reload.controls">Cache Revalidation and Reload Controls</a></h3> |
---|
1530 | <p id="rfc.section.16.2.4.p.1">Sometimes a user agent might want or need to insist that a cache revalidate its cache entry with the origin server (and not |
---|
1531 | just with the next cache along the path to the origin server), or to reload its cache entry from the origin server. End-to-end |
---|
1532 | revalidation might be necessary if either the cache or the origin server has overestimated the expiration time of the cached |
---|
1533 | response. End-to-end reload may be necessary if the cache entry has become corrupted for some reason. |
---|
1534 | </p> |
---|
1535 | <p id="rfc.section.16.2.4.p.2">End-to-end revalidation may be requested either when the client does not have its own local cached copy, in which case we |
---|
1536 | call it "unspecified end-to-end revalidation", or when the client does have a local cached copy, in which case we call it |
---|
1537 | "specific end-to-end revalidation." |
---|
1538 | </p> |
---|
1539 | <p id="rfc.section.16.2.4.p.3">The client can specify these three kinds of action using Cache-Control request directives:</p> |
---|
1540 | <p id="rfc.section.16.2.4.p.4">End-to-end reload </p> |
---|
1541 | <ul class="empty"> |
---|
1542 | <li>The request includes a "no-cache" cache-control directive or, for compatibility with HTTP/1.0 clients, "Pragma: no-cache". |
---|
1543 | Field names <em class="bcp14">MUST NOT</em> be included with the no-cache directive in a request. The server <em class="bcp14">MUST NOT</em> use a cached copy when responding to such a request. |
---|
1544 | </li> |
---|
1545 | </ul> |
---|
1546 | <p id="rfc.section.16.2.4.p.5">Specific end-to-end revalidation </p> |
---|
1547 | <ul class="empty"> |
---|
1548 | <li>The request includes a "max-age=0" cache-control directive, which forces each cache along the path to the origin server to |
---|
1549 | revalidate its own entry, if any, with the next cache or server. The initial request includes a cache-validating conditional |
---|
1550 | with the client's current validator. |
---|
1551 | </li> |
---|
1552 | </ul> |
---|
1553 | <p id="rfc.section.16.2.4.p.6">Unspecified end-to-end revalidation </p> |
---|
1554 | <ul class="empty"> |
---|
1555 | <li>The request includes "max-age=0" cache-control directive, which forces each cache along the path to the origin server to revalidate |
---|
1556 | its own entry, if any, with the next cache or server. The initial request does not include a cache-validating conditional; |
---|
1557 | the first cache along the path (if any) that holds a cache entry for this resource includes a cache-validating conditional |
---|
1558 | with its current validator. |
---|
1559 | </li> |
---|
1560 | </ul> |
---|
1561 | <p id="rfc.section.16.2.4.p.7"><span id="rfc.iref.c.12"></span> <span id="rfc.iref.m.4"></span> max-age |
---|
1562 | </p> |
---|
1563 | <ul class="empty"> |
---|
1564 | <li>When an intermediate cache is forced, by means of a max-age=0 directive, to revalidate its own cache entry, and the client |
---|
1565 | has supplied its own validator in the request, the supplied validator might differ from the validator currently stored with |
---|
1566 | the cache entry. In this case, the cache <em class="bcp14">MAY</em> use either validator in making its own request without affecting semantic transparency. |
---|
1567 | </li> |
---|
1568 | <li>However, the choice of validator might affect performance. The best approach is for the intermediate cache to use its own |
---|
1569 | validator when making its request. If the server replies with 304 (Not Modified), then the cache can return its now validated |
---|
1570 | copy to the client with a 200 (OK) response. If the server replies with a new entity and cache validator, however, the intermediate |
---|
1571 | cache can compare the returned validator with the one provided in the client's request, using the strong comparison function. |
---|
1572 | If the client's validator is equal to the origin server's, then the intermediate cache simply returns 304 (Not Modified). |
---|
1573 | Otherwise, it returns the new entity with a 200 (OK) response. |
---|
1574 | </li> |
---|
1575 | <li>If a request includes the no-cache directive, it <em class="bcp14">SHOULD NOT</em> include min-fresh, max-stale, or max-age. |
---|
1576 | </li> |
---|
1577 | </ul> |
---|
1578 | <p id="rfc.section.16.2.4.p.8"><span id="rfc.iref.c.13"></span> <span id="rfc.iref.o.1"></span> only-if-cached |
---|
1579 | </p> |
---|
1580 | <ul class="empty"> |
---|
1581 | <li>In some cases, such as times of extremely poor network connectivity, a client may want a cache to return only those responses |
---|
1582 | that it currently has stored, and not to reload or revalidate with the origin server. To do this, the client may include the |
---|
1583 | only-if-cached directive in a request. If it receives this directive, a cache <em class="bcp14">SHOULD</em> either respond using a cached entry that is consistent with the other constraints of the request, or respond with a 504 (Gateway |
---|
1584 | Timeout) status. However, if a group of caches is being operated as a unified system with good internal connectivity, such |
---|
1585 | a request <em class="bcp14">MAY</em> be forwarded within that group of caches. |
---|
1586 | </li> |
---|
1587 | </ul> |
---|
1588 | <p id="rfc.section.16.2.4.p.9"><span id="rfc.iref.c.14"></span> <span id="rfc.iref.m.5"></span> must-revalidate |
---|
1589 | </p> |
---|
1590 | <ul class="empty"> |
---|
1591 | <li>Because a cache <em class="bcp14">MAY</em> be configured to ignore a server's specified expiration time, and because a client request <em class="bcp14">MAY</em> include a max-stale directive (which has a similar effect), the protocol also includes a mechanism for the origin server to |
---|
1592 | require revalidation of a cache entry on any subsequent use. When the must-revalidate directive is present in a response received |
---|
1593 | by a cache, that cache <em class="bcp14">MUST NOT</em> use the entry after it becomes stale to respond to a subsequent request without first revalidating it with the origin server. |
---|
1594 | (I.e., the cache <em class="bcp14">MUST</em> do an end-to-end revalidation every time, if, based solely on the origin server's Expires or max-age value, the cached response |
---|
1595 | is stale.) |
---|
1596 | </li> |
---|
1597 | <li>The must-revalidate directive is necessary to support reliable operation for certain protocol features. In all circumstances |
---|
1598 | an HTTP/1.1 cache <em class="bcp14">MUST</em> obey the must-revalidate directive; in particular, if the cache cannot reach the origin server for any reason, it <em class="bcp14">MUST</em> generate a 504 (Gateway Timeout) response. |
---|
1599 | </li> |
---|
1600 | <li>Servers <em class="bcp14">SHOULD</em> send the must-revalidate directive if and only if failure to revalidate a request on the entity could result in incorrect |
---|
1601 | operation, such as a silently unexecuted financial transaction. Recipients <em class="bcp14">MUST NOT</em> take any automated action that violates this directive, and <em class="bcp14">MUST NOT</em> automatically provide an unvalidated copy of the entity if revalidation fails. |
---|
1602 | </li> |
---|
1603 | <li>Although this is not recommended, user agents operating under severe connectivity constraints <em class="bcp14">MAY</em> violate this directive but, if so, <em class="bcp14">MUST</em> explicitly warn the user that an unvalidated response has been provided. The warning <em class="bcp14">MUST</em> be provided on each unvalidated access, and <em class="bcp14">SHOULD</em> require explicit user confirmation. |
---|
1604 | </li> |
---|
1605 | </ul> |
---|
1606 | <p id="rfc.section.16.2.4.p.10"><span id="rfc.iref.c.15"></span> <span id="rfc.iref.p.3"></span> proxy-revalidate |
---|
1607 | </p> |
---|
1608 | <ul class="empty"> |
---|
1609 | <li>The proxy-revalidate directive has the same meaning as the must-revalidate directive, except that it does not apply to non-shared |
---|
1610 | user agent caches. It can be used on a response to an authenticated request to permit the user's cache to store and later |
---|
1611 | return the response without needing to revalidate it (since it has already been authenticated once by that user), while still |
---|
1612 | requiring proxies that service many users to revalidate each time (in order to make sure that each user has been authenticated). |
---|
1613 | Note that such authenticated responses also need the public cache control directive in order to allow them to be cached at |
---|
1614 | all. |
---|
1615 | </li> |
---|
1616 | </ul> |
---|
1617 | </div> |
---|
1618 | <div id="no-transform.directive"> |
---|
1619 | <h3 id="rfc.section.16.2.5"><a href="#rfc.section.16.2.5">16.2.5</a> <a href="#no-transform.directive">No-Transform Directive</a></h3> |
---|
1620 | <p id="rfc.section.16.2.5.p.1"><span id="rfc.iref.c.16"></span> <span id="rfc.iref.n.3"></span> no-transform |
---|
1621 | </p> |
---|
1622 | <ul class="empty"> |
---|
1623 | <li>Implementors of intermediate caches (proxies) have found it useful to convert the media type of certain entity bodies. A non-transparent |
---|
1624 | proxy might, for example, convert between image formats in order to save cache space or to reduce the amount of traffic on |
---|
1625 | a slow link. |
---|
1626 | </li> |
---|
1627 | <li>Serious operational problems occur, however, when these transformations are applied to entity bodies intended for certain |
---|
1628 | kinds of applications. For example, applications for medical imaging, scientific data analysis and those using end-to-end |
---|
1629 | authentication, all depend on receiving an entity body that is bit for bit identical to the original entity-body. |
---|
1630 | </li> |
---|
1631 | <li>Therefore, if a message includes the no-transform directive, an intermediate cache or proxy <em class="bcp14">MUST NOT</em> change those headers that are listed in <a href="#non-modifiable.headers" title="Non-modifiable Headers">Section 7.2</a> as being subject to the no-transform directive. This implies that the cache or proxy <em class="bcp14">MUST NOT</em> change any aspect of the entity-body that is specified by these headers, including the value of the entity-body itself. |
---|
1632 | </li> |
---|
1633 | </ul> |
---|
1634 | </div> |
---|
1635 | <div id="cache.control.extensions"> |
---|
1636 | <h3 id="rfc.section.16.2.6"><a href="#rfc.section.16.2.6">16.2.6</a> <a href="#cache.control.extensions">Cache Control Extensions</a></h3> |
---|
1637 | <p id="rfc.section.16.2.6.p.1">The Cache-Control header field can be extended through the use of one or more cache-extension tokens, each with an optional |
---|
1638 | assigned value. Informational extensions (those which do not require a change in cache behavior) <em class="bcp14">MAY</em> be added without changing the semantics of other directives. Behavioral extensions are designed to work by acting as modifiers |
---|
1639 | to the existing base of cache directives. Both the new directive and the standard directive are supplied, such that applications |
---|
1640 | which do not understand the new directive will default to the behavior specified by the standard directive, and those that |
---|
1641 | understand the new directive will recognize it as modifying the requirements associated with the standard directive. In this |
---|
1642 | way, extensions to the cache-control directives can be made without requiring changes to the base protocol. |
---|
1643 | </p> |
---|
1644 | <p id="rfc.section.16.2.6.p.2">This extension mechanism depends on an HTTP cache obeying all of the cache-control directives defined for its native HTTP-version, |
---|
1645 | obeying certain extensions, and ignoring all directives that it does not understand. |
---|
1646 | </p> |
---|
1647 | <p id="rfc.section.16.2.6.p.3">For example, consider a hypothetical new response directive called community which acts as a modifier to the private directive. |
---|
1648 | We define this new directive to mean that, in addition to any non-shared cache, any cache which is shared only by members |
---|
1649 | of the community named within its value may cache the response. An origin server wishing to allow the UCI community to use |
---|
1650 | an otherwise private response in their shared cache(s) could do so by including |
---|
1651 | </p> |
---|
1652 | <div id="rfc.figure.u.15"></div><pre class="text"> Cache-Control: private, community="UCI" |
---|
1653 | </pre><p id="rfc.section.16.2.6.p.5">A cache seeing this header field will act correctly even if the cache does not understand the community cache-extension, since |
---|
1654 | it will also see and understand the private directive and thus default to the safe behavior. |
---|
1655 | </p> |
---|
1656 | <p id="rfc.section.16.2.6.p.6">Unrecognized cache-directives <em class="bcp14">MUST</em> be ignored; it is assumed that any cache-directive likely to be unrecognized by an HTTP/1.1 cache will be combined with standard |
---|
1657 | directives (or the response's default cacheability) such that the cache behavior will remain minimally correct even if the |
---|
1658 | cache does not understand the extension(s). |
---|
1659 | </p> |
---|
1660 | </div> |
---|
1661 | </div> |
---|
1662 | <div id="header.expires"> |
---|
1663 | <div id="rfc.iref.e.2"></div> |
---|
1664 | <div id="rfc.iref.h.4"></div> |
---|
1665 | <h2 id="rfc.section.16.3"><a href="#rfc.section.16.3">16.3</a> <a href="#header.expires">Expires</a></h2> |
---|
1666 | <p id="rfc.section.16.3.p.1">The Expires entity-header field gives the date/time after which the response is considered stale. A stale cache entry may |
---|
1667 | not normally be returned by a cache (either a proxy cache or a user agent cache) unless it is first validated with the origin |
---|
1668 | server (or with an intermediate cache that has a fresh copy of the entity). See <a href="#expiration.model" title="Expiration Model">Section 4</a> for further discussion of the expiration model. |
---|
1669 | </p> |
---|
1670 | <p id="rfc.section.16.3.p.2">The presence of an Expires field does not imply that the original resource will change or cease to exist at, before, or after |
---|
1671 | that time. |
---|
1672 | </p> |
---|
1673 | <p id="rfc.section.16.3.p.3">The format is an absolute date and time as defined by HTTP-date in <a href="p1-messaging.html#full.date" title="Full Date">Section 3.3.1</a> of <a href="#Part1" id="rfc.xref.Part1.18"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>; it <em class="bcp14">MUST</em> be sent in rfc1123-date format. |
---|
1674 | </p> |
---|
1675 | <div id="rfc.figure.u.16"></div><pre class="inline"><span id="rfc.iref.g.9"></span> <a href="#header.expires" class="smpl">Expires</a> = "Expires" ":" <a href="#abnf.dependencies" class="smpl">HTTP-date</a> |
---|
1676 | </pre><p id="rfc.section.16.3.p.5">An example of its use is</p> |
---|
1677 | <div id="rfc.figure.u.17"></div><pre class="text"> Expires: Thu, 01 Dec 1994 16:00:00 GMT |
---|
1678 | </pre><p id="rfc.section.16.3.p.7"></p> |
---|
1679 | <ul class="empty"> |
---|
1680 | <li><b>Note:</b> if a response includes a Cache-Control field with the max-age directive (see <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section 16.2.3</a>), that directive overrides the Expires field. |
---|
1681 | </li> |
---|
1682 | </ul> |
---|
1683 | <p id="rfc.section.16.3.p.8">HTTP/1.1 clients and caches <em class="bcp14">MUST</em> treat other invalid date formats, especially including the value "0", as in the past (i.e., "already expired"). |
---|
1684 | </p> |
---|
1685 | <p id="rfc.section.16.3.p.9">To mark a response as "already expired," an origin server sends an Expires date that is equal to the Date header value. (See |
---|
1686 | the rules for expiration calculations in <a href="#expiration.calculations" title="Expiration Calculations">Section 4.4</a>.) |
---|
1687 | </p> |
---|
1688 | <p id="rfc.section.16.3.p.10">To mark a response as "never expires," an origin server sends an Expires date approximately one year from the time the response |
---|
1689 | is sent. HTTP/1.1 servers <em class="bcp14">SHOULD NOT</em> send Expires dates more than one year in the future. |
---|
1690 | </p> |
---|
1691 | <p id="rfc.section.16.3.p.11">The presence of an Expires header field with a date value of some time in the future on a response that otherwise would by |
---|
1692 | default be non-cacheable indicates that the response is cacheable, unless indicated otherwise by a Cache-Control header field |
---|
1693 | (<a href="#header.cache-control" id="rfc.xref.header.cache-control.9" title="Cache-Control">Section 16.2</a>). |
---|
1694 | </p> |
---|
1695 | </div> |
---|
1696 | <div id="header.pragma"> |
---|
1697 | <div id="rfc.iref.p.4"></div> |
---|
1698 | <div id="rfc.iref.h.5"></div> |
---|
1699 | <h2 id="rfc.section.16.4"><a href="#rfc.section.16.4">16.4</a> <a href="#header.pragma">Pragma</a></h2> |
---|
1700 | <p id="rfc.section.16.4.p.1">The Pragma general-header field is used to include implementation-specific directives that might apply to any recipient along |
---|
1701 | the request/response chain. All pragma directives specify optional behavior from the viewpoint of the protocol; however, some |
---|
1702 | systems <em class="bcp14">MAY</em> require that behavior be consistent with the directives. |
---|
1703 | </p> |
---|
1704 | <div id="rfc.figure.u.18"></div><pre class="inline"><span id="rfc.iref.g.10"></span><span id="rfc.iref.g.11"></span><span id="rfc.iref.g.12"></span> <a href="#header.pragma" class="smpl">Pragma</a> = "Pragma" ":" 1#<a href="#header.pragma" class="smpl">pragma-directive</a> |
---|
1705 | <a href="#header.pragma" class="smpl">pragma-directive</a> = "no-cache" | <a href="#header.pragma" class="smpl">extension-pragma</a> |
---|
1706 | <a href="#header.pragma" class="smpl">extension-pragma</a> = <a href="#notation" class="smpl">token</a> [ "=" ( <a href="#notation" class="smpl">token</a> | <a href="#notation" class="smpl">quoted-string</a> ) ] |
---|
1707 | </pre><p id="rfc.section.16.4.p.3">When the no-cache directive is present in a request message, an application <em class="bcp14">SHOULD</em> forward the request toward the origin server even if it has a cached copy of what is being requested. This pragma directive |
---|
1708 | has the same semantics as the no-cache cache-directive (see <a href="#header.cache-control" id="rfc.xref.header.cache-control.10" title="Cache-Control">Section 16.2</a>) and is defined here for backward compatibility with HTTP/1.0. Clients <em class="bcp14">SHOULD</em> include both header fields when a no-cache request is sent to a server not known to be HTTP/1.1 compliant. |
---|
1709 | </p> |
---|
1710 | <p id="rfc.section.16.4.p.4">Pragma directives <em class="bcp14">MUST</em> be passed through by a proxy or gateway application, regardless of their significance to that application, since the directives |
---|
1711 | might be applicable to all recipients along the request/response chain. It is not possible to specify a pragma for a specific |
---|
1712 | recipient; however, any pragma directive not relevant to a recipient <em class="bcp14">SHOULD</em> be ignored by that recipient. |
---|
1713 | </p> |
---|
1714 | <p id="rfc.section.16.4.p.5">HTTP/1.1 caches <em class="bcp14">SHOULD</em> treat "Pragma: no-cache" as if the client had sent "Cache-Control: no-cache". No new Pragma directives will be defined in |
---|
1715 | HTTP. |
---|
1716 | </p> |
---|
1717 | <ul class="empty"> |
---|
1718 | <li><b>Note:</b> because the meaning of "Pragma: no-cache" as a response-header field is not actually specified, it does not provide a reliable |
---|
1719 | replacement for "Cache-Control: no-cache" in a response. |
---|
1720 | </li> |
---|
1721 | </ul> |
---|
1722 | </div> |
---|
1723 | <div id="header.vary"> |
---|
1724 | <div id="rfc.iref.v.2"></div> |
---|
1725 | <div id="rfc.iref.h.6"></div> |
---|
1726 | <h2 id="rfc.section.16.5"><a href="#rfc.section.16.5">16.5</a> <a href="#header.vary">Vary</a></h2> |
---|
1727 | <p id="rfc.section.16.5.p.1">The Vary response-header field's value indicates the set of request-header fields that fully determines, while the response |
---|
1728 | is fresh, whether a cache is permitted to use the response to reply to a subsequent request without revalidation. For uncacheable |
---|
1729 | or stale responses, the Vary field value advises the user agent about the criteria that were used to select the representation. |
---|
1730 | A Vary field value of "*" implies that a cache cannot determine from the request headers of a subsequent request whether this |
---|
1731 | response is the appropriate representation. See <a href="#caching.negotiated.responses" title="Caching Negotiated Responses">Section 8</a> for use of the Vary header field by caches. |
---|
1732 | </p> |
---|
1733 | <div id="rfc.figure.u.19"></div><pre class="inline"><span id="rfc.iref.g.13"></span> <a href="#header.vary" class="smpl">Vary</a> = "Vary" ":" ( "*" | 1#<a href="#abnf.dependencies" class="smpl">field-name</a> ) |
---|
1734 | </pre><p id="rfc.section.16.5.p.3">An HTTP/1.1 server <em class="bcp14">SHOULD</em> include a Vary header field with any cacheable response that is subject to server-driven negotiation. Doing so allows a cache |
---|
1735 | to properly interpret future requests on that resource and informs the user agent about the presence of negotiation on that |
---|
1736 | resource. A server <em class="bcp14">MAY</em> include a Vary header field with a non-cacheable response that is subject to server-driven negotiation, since this might provide |
---|
1737 | the user agent with useful information about the dimensions over which the response varies at the time of the response. |
---|
1738 | </p> |
---|
1739 | <p id="rfc.section.16.5.p.4">A Vary field value consisting of a list of field-names signals that the representation selected for the response is based |
---|
1740 | on a selection algorithm which considers ONLY the listed request-header field values in selecting the most appropriate representation. |
---|
1741 | A cache <em class="bcp14">MAY</em> assume that the same selection will be made for future requests with the same values for the listed field names, for the duration |
---|
1742 | of time for which the response is fresh. |
---|
1743 | </p> |
---|
1744 | <p id="rfc.section.16.5.p.5">The field-names given are not limited to the set of standard request-header fields defined by this specification. Field names |
---|
1745 | are case-insensitive. |
---|
1746 | </p> |
---|
1747 | <p id="rfc.section.16.5.p.6">A Vary field value of "*" signals that unspecified parameters not limited to the request-headers (e.g., the network address |
---|
1748 | of the client), play a role in the selection of the response representation. The "*" value <em class="bcp14">MUST NOT</em> be generated by a proxy server; it may only be generated by an origin server. |
---|
1749 | </p> |
---|
1750 | </div> |
---|
1751 | <div id="header.warning"> |
---|
1752 | <div id="rfc.iref.w.1"></div> |
---|
1753 | <div id="rfc.iref.h.7"></div> |
---|
1754 | <h2 id="rfc.section.16.6"><a href="#rfc.section.16.6">16.6</a> <a href="#header.warning">Warning</a></h2> |
---|
1755 | <p id="rfc.section.16.6.p.1">The Warning general-header field is used to carry additional information about the status or transformation of a message which |
---|
1756 | might not be reflected in the message. This information is typically used to warn about a possible lack of semantic transparency |
---|
1757 | from caching operations or transformations applied to the entity body of the message. |
---|
1758 | </p> |
---|
1759 | <p id="rfc.section.16.6.p.2">Warning headers are sent with responses using:</p> |
---|
1760 | <div id="rfc.figure.u.20"></div><pre class="inline"><span id="rfc.iref.g.14"></span><span id="rfc.iref.g.15"></span><span id="rfc.iref.g.16"></span><span id="rfc.iref.g.17"></span><span id="rfc.iref.g.18"></span><span id="rfc.iref.g.19"></span> <a href="#header.warning" class="smpl">Warning</a> = "Warning" ":" 1#<a href="#header.warning" class="smpl">warning-value</a> |
---|
1761 | |
---|
1762 | <a href="#header.warning" class="smpl">warning-value</a> = <a href="#header.warning" class="smpl">warn-code</a> <a href="#notation" class="smpl">SP</a> <a href="#header.warning" class="smpl">warn-agent</a> <a href="#notation" class="smpl">SP</a> <a href="#header.warning" class="smpl">warn-text</a> |
---|
1763 | [<a href="#notation" class="smpl">SP</a> <a href="#header.warning" class="smpl">warn-date</a>] |
---|
1764 | |
---|
1765 | <a href="#header.warning" class="smpl">warn-code</a> = 3<a href="#notation" class="smpl">DIGIT</a> |
---|
1766 | <a href="#header.warning" class="smpl">warn-agent</a> = ( <a href="#abnf.dependencies" class="smpl">uri-host</a> [ ":" <a href="#abnf.dependencies" class="smpl">port</a> ] ) | <a href="#abnf.dependencies" class="smpl">pseudonym</a> |
---|
1767 | ; the name or pseudonym of the server adding |
---|
1768 | ; the Warning header, for use in debugging |
---|
1769 | <a href="#header.warning" class="smpl">warn-text</a> = <a href="#notation" class="smpl">quoted-string</a> |
---|
1770 | <a href="#header.warning" class="smpl">warn-date</a> = <a href="#notation" class="smpl">DQUOTE</a> <a href="#abnf.dependencies" class="smpl">HTTP-date</a> <a href="#notation" class="smpl">DQUOTE</a> |
---|
1771 | </pre><p id="rfc.section.16.6.p.4">A response <em class="bcp14">MAY</em> carry more than one Warning header. |
---|
1772 | </p> |
---|
1773 | <p id="rfc.section.16.6.p.5">The warn-text <em class="bcp14">SHOULD</em> be in a natural language and character set that is most likely to be intelligible to the human user receiving the response. |
---|
1774 | This decision <em class="bcp14">MAY</em> be based on any available knowledge, such as the location of the cache or user, the Accept-Language field in a request, the |
---|
1775 | Content-Language field in a response, etc. The default language is English and the default character set is ISO-8859-1 (<a href="#ISO-8859-1" id="rfc.xref.ISO-8859-1.1"><cite title="Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1">[ISO-8859-1]</cite></a>). |
---|
1776 | </p> |
---|
1777 | <p id="rfc.section.16.6.p.6">If a character set other than ISO-8859-1 is used, it <em class="bcp14">MUST</em> be encoded in the warn-text using the method described in <a href="#RFC2047" id="rfc.xref.RFC2047.1"><cite title="MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text">[RFC2047]</cite></a>. |
---|
1778 | </p> |
---|
1779 | <p id="rfc.section.16.6.p.7">Warning headers can in general be applied to any message, however some specific warn-codes are specific to caches and can |
---|
1780 | only be applied to response messages. New Warning headers <em class="bcp14">SHOULD</em> be added after any existing Warning headers. A cache <em class="bcp14">MUST NOT</em> delete any Warning header that it received with a message. However, if a cache successfully validates a cache entry, it <em class="bcp14">SHOULD</em> remove any Warning headers previously attached to that entry except as specified for specific Warning codes. It <em class="bcp14">MUST</em> then add any Warning headers received in the validating response. In other words, Warning headers are those that would be |
---|
1781 | attached to the most recent relevant response. |
---|
1782 | </p> |
---|
1783 | <p id="rfc.section.16.6.p.8">When multiple Warning headers are attached to a response, the user agent ought to inform the user of as many of them as possible, |
---|
1784 | in the order that they appear in the response. If it is not possible to inform the user of all of the warnings, the user agent <em class="bcp14">SHOULD</em> follow these heuristics: |
---|
1785 | </p> |
---|
1786 | <ul> |
---|
1787 | <li>Warnings that appear early in the response take priority over those appearing later in the response.</li> |
---|
1788 | <li>Warnings in the user's preferred character set take priority over warnings in other character sets but with identical warn-codes |
---|
1789 | and warn-agents. |
---|
1790 | </li> |
---|
1791 | </ul> |
---|
1792 | <p id="rfc.section.16.6.p.9">Systems that generate multiple Warning headers <em class="bcp14">SHOULD</em> order them with this user agent behavior in mind. |
---|
1793 | </p> |
---|
1794 | <p id="rfc.section.16.6.p.10">Requirements for the behavior of caches with respect to Warnings are stated in <a href="#warnings" title="Warnings">Section 3.2</a>. |
---|
1795 | </p> |
---|
1796 | <p id="rfc.section.16.6.p.11">This is a list of the currently-defined warn-codes, each with a recommended warn-text in English, and a description of its |
---|
1797 | meaning. |
---|
1798 | </p> |
---|
1799 | <p id="rfc.section.16.6.p.12">110 Response is stale </p> |
---|
1800 | <ul class="empty"> |
---|
1801 | <li><em class="bcp14">MUST</em> be included whenever the returned response is stale. |
---|
1802 | </li> |
---|
1803 | </ul> |
---|
1804 | <p id="rfc.section.16.6.p.13">111 Revalidation failed </p> |
---|
1805 | <ul class="empty"> |
---|
1806 | <li><em class="bcp14">MUST</em> be included if a cache returns a stale response because an attempt to revalidate the response failed, due to an inability |
---|
1807 | to reach the server. |
---|
1808 | </li> |
---|
1809 | </ul> |
---|
1810 | <p id="rfc.section.16.6.p.14">112 Disconnected operation </p> |
---|
1811 | <ul class="empty"> |
---|
1812 | <li><em class="bcp14">SHOULD</em> be included if the cache is intentionally disconnected from the rest of the network for a period of time. |
---|
1813 | </li> |
---|
1814 | </ul> |
---|
1815 | <p id="rfc.section.16.6.p.15">113 Heuristic expiration </p> |
---|
1816 | <ul class="empty"> |
---|
1817 | <li><em class="bcp14">MUST</em> be included if the cache heuristically chose a freshness lifetime greater than 24 hours and the response's age is greater |
---|
1818 | than 24 hours. |
---|
1819 | </li> |
---|
1820 | </ul> |
---|
1821 | <p id="rfc.section.16.6.p.16">199 Miscellaneous warning </p> |
---|
1822 | <ul class="empty"> |
---|
1823 | <li>The warning text <em class="bcp14">MAY</em> include arbitrary information to be presented to a human user, or logged. A system receiving this warning <em class="bcp14">MUST NOT</em> take any automated action, besides presenting the warning to the user. |
---|
1824 | </li> |
---|
1825 | </ul> |
---|
1826 | <p id="rfc.section.16.6.p.17">214 Transformation applied </p> |
---|
1827 | <ul class="empty"> |
---|
1828 | <li><em class="bcp14">MUST</em> be added by an intermediate cache or proxy if it applies any transformation changing the content-coding (as specified in the |
---|
1829 | Content-Encoding header) or media-type (as specified in the Content-Type header) of the response, or the entity-body of the |
---|
1830 | response, unless this Warning code already appears in the response. |
---|
1831 | </li> |
---|
1832 | </ul> |
---|
1833 | <p id="rfc.section.16.6.p.18">299 Miscellaneous persistent warning </p> |
---|
1834 | <ul class="empty"> |
---|
1835 | <li>The warning text <em class="bcp14">MAY</em> include arbitrary information to be presented to a human user, or logged. A system receiving this warning <em class="bcp14">MUST NOT</em> take any automated action. |
---|
1836 | </li> |
---|
1837 | </ul> |
---|
1838 | <p id="rfc.section.16.6.p.19">If an implementation sends a message with one or more Warning headers whose version is HTTP/1.0 or lower, then the sender <em class="bcp14">MUST</em> include in each warning-value a warn-date that matches the date in the response. |
---|
1839 | </p> |
---|
1840 | <p id="rfc.section.16.6.p.20">If an implementation receives a message with a warning-value that includes a warn-date, and that warn-date is different from |
---|
1841 | the Date value in the response, then that warning-value <em class="bcp14">MUST</em> be deleted from the message before storing, forwarding, or using it. (This prevents bad consequences of naive caching of Warning |
---|
1842 | header fields.) If all of the warning-values are deleted for this reason, the Warning header <em class="bcp14">MUST</em> be deleted as well. |
---|
1843 | </p> |
---|
1844 | </div> |
---|
1845 | </div> |
---|
1846 | <div id="IANA.considerations"> |
---|
1847 | <h1 id="rfc.section.17"><a href="#rfc.section.17">17.</a> <a href="#IANA.considerations">IANA Considerations</a></h1> |
---|
1848 | <div id="message.header.registration"> |
---|
1849 | <h2 id="rfc.section.17.1"><a href="#rfc.section.17.1">17.1</a> <a href="#message.header.registration">Message Header Registration</a></h2> |
---|
1850 | <p id="rfc.section.17.1.p.1">The Message Header Registry located at <<a href="http://www.iana.org/assignments/message-headers/message-header-index.html">http://www.iana.org/assignments/message-headers/message-header-index.html</a>> should be updated with the permanent registrations below (see <a href="#RFC3864" id="rfc.xref.RFC3864.1"><cite title="Registration Procedures for Message Header Fields">[RFC3864]</cite></a>): |
---|
1851 | </p> |
---|
1852 | <div id="rfc.table.1"> |
---|
1853 | <div id="iana.header.registration.table"></div> |
---|
1854 | <table class="tt full left" cellpadding="3" cellspacing="0"> |
---|
1855 | <thead> |
---|
1856 | <tr> |
---|
1857 | <th>Header Field Name</th> |
---|
1858 | <th>Protocol</th> |
---|
1859 | <th>Status</th> |
---|
1860 | <th>Reference</th> |
---|
1861 | </tr> |
---|
1862 | </thead> |
---|
1863 | <tbody> |
---|
1864 | <tr> |
---|
1865 | <td class="left">Age</td> |
---|
1866 | <td class="left">http</td> |
---|
1867 | <td class="left">standard</td> |
---|
1868 | <td class="left"><a href="#header.age" id="rfc.xref.header.age.1" title="Age">Section 16.1</a> |
---|
1869 | </td> |
---|
1870 | </tr> |
---|
1871 | <tr> |
---|
1872 | <td class="left">Cache-Control</td> |
---|
1873 | <td class="left">http</td> |
---|
1874 | <td class="left">standard</td> |
---|
1875 | <td class="left"><a href="#header.cache-control" id="rfc.xref.header.cache-control.11" title="Cache-Control">Section 16.2</a> |
---|
1876 | </td> |
---|
1877 | </tr> |
---|
1878 | <tr> |
---|
1879 | <td class="left">Expires</td> |
---|
1880 | <td class="left">http</td> |
---|
1881 | <td class="left">standard</td> |
---|
1882 | <td class="left"><a href="#header.expires" id="rfc.xref.header.expires.3" title="Expires">Section 16.3</a> |
---|
1883 | </td> |
---|
1884 | </tr> |
---|
1885 | <tr> |
---|
1886 | <td class="left">Pragma</td> |
---|
1887 | <td class="left">http</td> |
---|
1888 | <td class="left">standard</td> |
---|
1889 | <td class="left"><a href="#header.pragma" id="rfc.xref.header.pragma.2" title="Pragma">Section 16.4</a> |
---|
1890 | </td> |
---|
1891 | </tr> |
---|
1892 | <tr> |
---|
1893 | <td class="left">Vary</td> |
---|
1894 | <td class="left">http</td> |
---|
1895 | <td class="left">standard</td> |
---|
1896 | <td class="left"><a href="#header.vary" id="rfc.xref.header.vary.2" title="Vary">Section 16.5</a> |
---|
1897 | </td> |
---|
1898 | </tr> |
---|
1899 | <tr> |
---|
1900 | <td class="left">Warning</td> |
---|
1901 | <td class="left">http</td> |
---|
1902 | <td class="left">standard</td> |
---|
1903 | <td class="left"><a href="#header.warning" id="rfc.xref.header.warning.6" title="Warning">Section 16.6</a> |
---|
1904 | </td> |
---|
1905 | </tr> |
---|
1906 | </tbody> |
---|
1907 | </table> |
---|
1908 | </div> |
---|
1909 | <p id="rfc.section.17.1.p.2">The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".</p> |
---|
1910 | </div> |
---|
1911 | </div> |
---|
1912 | <div id="security.considerations"> |
---|
1913 | <h1 id="rfc.section.18"><a href="#rfc.section.18">18.</a> <a href="#security.considerations">Security Considerations</a></h1> |
---|
1914 | <p id="rfc.section.18.p.1">Caching proxies provide additional potential vulnerabilities, since the contents of the cache represent an attractive target |
---|
1915 | for malicious exploitation. Because cache contents persist after an HTTP request is complete, an attack on the cache can reveal |
---|
1916 | information long after a user believes that the information has been removed from the network. Therefore, cache contents should |
---|
1917 | be protected as sensitive information. |
---|
1918 | </p> |
---|
1919 | </div> |
---|
1920 | <div id="ack"> |
---|
1921 | <h1 id="rfc.section.19"><a href="#rfc.section.19">19.</a> <a href="#ack">Acknowledgments</a></h1> |
---|
1922 | <p id="rfc.section.19.p.1">Much of the content and presentation of the caching design is due to suggestions and comments from individuals including: |
---|
1923 | Shel Kaphan, Paul Leach, Koen Holtman, David Morris, and Larry Masinter. |
---|
1924 | </p> |
---|
1925 | </div> |
---|
1926 | <h1 id="rfc.references"><a id="rfc.section.20" href="#rfc.section.20">20.</a> References |
---|
1927 | </h1> |
---|
1928 | <h2 id="rfc.references.1"><a href="#rfc.section.20.1" id="rfc.section.20.1">20.1</a> Normative References |
---|
1929 | </h2> |
---|
1930 | <table> |
---|
1931 | <tr> |
---|
1932 | <td class="reference"><b id="ISO-8859-1">[ISO-8859-1]</b></td> |
---|
1933 | <td class="top">International Organization for Standardization, “Information technology -- 8-bit single-byte coded graphic character sets -- Part 1: Latin alphabet No. 1”, ISO/IEC 8859-1:1998, 1998.</td> |
---|
1934 | </tr> |
---|
1935 | <tr> |
---|
1936 | <td class="reference"><b id="Part1">[Part1]</b></td> |
---|
1937 | <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">Berners-Lee, T.</a>, <a href="mailto:ylafon@w3.org" title="World Wide Web Consortium">Lafon, Y., Ed.</a>, and <a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">J. Reschke, Ed.</a>, “<a href="https://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-04">HTTP/1.1, part 1: URIs, Connections, and Message Parsing</a>”, Internet-Draft draft-ietf-httpbis-p1-messaging-04 (work in progress), August 2008. |
---|
1938 | </td> |
---|
1939 | </tr> |
---|
1940 | <tr> |
---|
1941 | <td class="reference"><b id="Part2">[Part2]</b></td> |
---|
1942 | <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">Berners-Lee, T.</a>, <a href="mailto:ylafon@w3.org" title="World Wide Web Consortium">Lafon, Y., Ed.</a>, and <a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">J. Reschke, Ed.</a>, “<a href="https://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-04">HTTP/1.1, part 2: Message Semantics</a>”, Internet-Draft draft-ietf-httpbis-p2-semantics-04 (work in progress), August 2008. |
---|
1943 | </td> |
---|
1944 | </tr> |
---|
1945 | <tr> |
---|
1946 | <td class="reference"><b id="Part3">[Part3]</b></td> |
---|
1947 | <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">Berners-Lee, T.</a>, <a href="mailto:ylafon@w3.org" title="World Wide Web Consortium">Lafon, Y., Ed.</a>, and <a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">J. Reschke, Ed.</a>, “<a href="https://tools.ietf.org/html/draft-ietf-httpbis-p3-payload-04">HTTP/1.1, part 3: Message Payload and Content Negotiation</a>”, Internet-Draft draft-ietf-httpbis-p3-payload-04 (work in progress), August 2008. |
---|
1948 | </td> |
---|
1949 | </tr> |
---|
1950 | <tr> |
---|
1951 | <td class="reference"><b id="Part4">[Part4]</b></td> |
---|
1952 | <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">Berners-Lee, T.</a>, <a href="mailto:ylafon@w3.org" title="World Wide Web Consortium">Lafon, Y., Ed.</a>, and <a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">J. Reschke, Ed.</a>, “<a href="https://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-04">HTTP/1.1, part 4: Conditional Requests</a>”, Internet-Draft draft-ietf-httpbis-p4-conditional-04 (work in progress), August 2008. |
---|
1953 | </td> |
---|
1954 | </tr> |
---|
1955 | <tr> |
---|
1956 | <td class="reference"><b id="Part5">[Part5]</b></td> |
---|
1957 | <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">Berners-Lee, T.</a>, <a href="mailto:ylafon@w3.org" title="World Wide Web Consortium">Lafon, Y., Ed.</a>, and <a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">J. Reschke, Ed.</a>, “<a href="https://tools.ietf.org/html/draft-ietf-httpbis-p5-range-04">HTTP/1.1, part 5: Range Requests and Partial Responses</a>”, Internet-Draft draft-ietf-httpbis-p5-range-04 (work in progress), August 2008. |
---|
1958 | </td> |
---|
1959 | </tr> |
---|
1960 | <tr> |
---|
1961 | <td class="reference"><b id="Part7">[Part7]</b></td> |
---|
1962 | <td class="top"><a href="mailto:fielding@gbiv.com" title="Day Software">Fielding, R., Ed.</a>, <a href="mailto:jg@laptop.org" title="One Laptop per Child">Gettys, J.</a>, <a href="mailto:JeffMogul@acm.org" title="Hewlett-Packard Company">Mogul, J.</a>, <a href="mailto:henrikn@microsoft.com" title="Microsoft Corporation">Frystyk, H.</a>, <a href="mailto:LMM@acm.org" title="Adobe Systems, Incorporated">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, <a href="mailto:timbl@w3.org" title="World Wide Web Consortium">Berners-Lee, T.</a>, <a href="mailto:ylafon@w3.org" title="World Wide Web Consortium">Lafon, Y., Ed.</a>, and <a href="mailto:julian.reschke@greenbytes.de" title="greenbytes GmbH">J. Reschke, Ed.</a>, “<a href="https://tools.ietf.org/html/draft-ietf-httpbis-p7-auth-04">HTTP/1.1, part 7: Authentication</a>”, Internet-Draft draft-ietf-httpbis-p7-auth-04 (work in progress), August 2008. |
---|
1963 | </td> |
---|
1964 | </tr> |
---|
1965 | <tr> |
---|
1966 | <td class="reference"><b id="RFC2047">[RFC2047]</b></td> |
---|
1967 | <td class="top"><a href="mailto:moore@cs.utk.edu" title="University of Tennessee">Moore, K.</a>, “<a href="https://tools.ietf.org/html/rfc2047">MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text</a>”, RFC 2047, November 1996. |
---|
1968 | </td> |
---|
1969 | </tr> |
---|
1970 | <tr> |
---|
1971 | <td class="reference"><b id="RFC2119">[RFC2119]</b></td> |
---|
1972 | <td class="top"><a href="mailto:sob@harvard.edu" title="Harvard University">Bradner, S.</a>, “<a href="https://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>”, BCP 14, RFC 2119, March 1997. |
---|
1973 | </td> |
---|
1974 | </tr> |
---|
1975 | </table> |
---|
1976 | <h2 id="rfc.references.2"><a href="#rfc.section.20.2" id="rfc.section.20.2">20.2</a> Informative References |
---|
1977 | </h2> |
---|
1978 | <table> |
---|
1979 | <tr> |
---|
1980 | <td class="reference"><b id="RFC1305">[RFC1305]</b></td> |
---|
1981 | <td class="top"><a href="mailto:mills@udel.edu" title="University of Delaware, Electrical Engineering Department">Mills, D.</a>, “<a href="https://tools.ietf.org/html/rfc1305">Network Time Protocol (Version 3) Specification, Implementation</a>”, RFC 1305, March 1992. |
---|
1982 | </td> |
---|
1983 | </tr> |
---|
1984 | <tr> |
---|
1985 | <td class="reference"><b id="RFC2616">[RFC2616]</b></td> |
---|
1986 | <td class="top"><a href="mailto:fielding@ics.uci.edu" title="University of California, Irvine">Fielding, R.</a>, <a href="mailto:jg@w3.org" title="W3C">Gettys, J.</a>, <a href="mailto:mogul@wrl.dec.com" title="Compaq Computer Corporation">Mogul, J.</a>, <a href="mailto:frystyk@w3.org" title="MIT Laboratory for Computer Science">Frystyk, H.</a>, <a href="mailto:masinter@parc.xerox.com" title="Xerox Corporation">Masinter, L.</a>, <a href="mailto:paulle@microsoft.com" title="Microsoft Corporation">Leach, P.</a>, and <a href="mailto:timbl@w3.org" title="W3C">T. Berners-Lee</a>, “<a href="https://tools.ietf.org/html/rfc2616">Hypertext Transfer Protocol -- HTTP/1.1</a>”, RFC 2616, June 1999. |
---|
1987 | </td> |
---|
1988 | </tr> |
---|
1989 | <tr> |
---|
1990 | <td class="reference"><b id="RFC3864">[RFC3864]</b></td> |
---|
1991 | <td class="top"><a href="mailto:GK-IETF@ninebynine.org" title="Nine by Nine">Klyne, G.</a>, <a href="mailto:mnot@pobox.com" title="BEA Systems">Nottingham, M.</a>, and <a href="mailto:JeffMogul@acm.org" title="HP Labs">J. Mogul</a>, “<a href="https://tools.ietf.org/html/rfc3864">Registration Procedures for Message Header Fields</a>”, BCP 90, RFC 3864, September 2004. |
---|
1992 | </td> |
---|
1993 | </tr> |
---|
1994 | </table> |
---|
1995 | <div id="compatibility"> |
---|
1996 | <h1 id="rfc.section.A" class="np"><a href="#rfc.section.A">A.</a> <a href="#compatibility">Compatibility with Previous Versions</a></h1> |
---|
1997 | <div id="changes.from.rfc.2068"> |
---|
1998 | <h2 id="rfc.section.A.1"><a href="#rfc.section.A.1">A.1</a> <a href="#changes.from.rfc.2068">Changes from RFC 2068</a></h2> |
---|
1999 | <p id="rfc.section.A.1.p.1">A case was missed in the Cache-Control model of HTTP/1.1; s-maxage was introduced to add this missing case. (Sections <a href="#response.cacheability" title="Response Cacheability">6</a>, <a href="#header.cache-control" id="rfc.xref.header.cache-control.12" title="Cache-Control">16.2</a>, <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">16.2.3</a>) |
---|
2000 | </p> |
---|
2001 | <p id="rfc.section.A.1.p.2">Transfer-coding and message lengths all interact in ways that required fixing exactly when chunked encoding is used (to allow |
---|
2002 | for transfer encoding that may not be self delimiting); it was important to straighten out exactly how message lengths are |
---|
2003 | computed. (<a href="#non-modifiable.headers" title="Non-modifiable Headers">Section 7.2</a>, see also <a href="#Part1" id="rfc.xref.Part1.19"><cite title="HTTP/1.1, part 1: URIs, Connections, and Message Parsing">[Part1]</cite></a>, <a href="#Part3" id="rfc.xref.Part3.3"><cite title="HTTP/1.1, part 3: Message Payload and Content Negotiation">[Part3]</cite></a> and <a href="#Part5" id="rfc.xref.Part5.3"><cite title="HTTP/1.1, part 5: Range Requests and Partial Responses">[Part5]</cite></a>) |
---|
2004 | </p> |
---|
2005 | <p id="rfc.section.A.1.p.3">Proxies should be able to add Content-Length when appropriate. (<a href="#non-modifiable.headers" title="Non-modifiable Headers">Section 7.2</a>) |
---|
2006 | </p> |
---|
2007 | <p id="rfc.section.A.1.p.4">Range request responses would become very verbose if all meta-data were always returned; by allowing the server to only send |
---|
2008 | needed headers in a 206 response, this problem can be avoided. (<a href="#combining.headers" title="Combining Headers">Section 7.3</a>) |
---|
2009 | </p> |
---|
2010 | <p id="rfc.section.A.1.p.5">The Cache-Control: max-age directive was not properly defined for responses. (<a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">Section 16.2.3</a>) |
---|
2011 | </p> |
---|
2012 | <p id="rfc.section.A.1.p.6">Warnings could be cached incorrectly, or not updated appropriately. (Section <a href="#warnings" title="Warnings">3.2</a>, <a href="#expiration.calculations" title="Expiration Calculations">4.4</a>, <a href="#non-modifiable.headers" title="Non-modifiable Headers">7.2</a>, <a href="#combining.headers" title="Combining Headers">7.3</a>, <a href="#modifications.of.the.basic.expiration.mechanism" title="Modifications of the Basic Expiration Mechanism">16.2.3</a>, and <a href="#header.warning" id="rfc.xref.header.warning.7" title="Warning">16.6</a>) Warning also needed to be a general header, as PUT or other methods may have need for it in requests. |
---|
2013 | </p> |
---|
2014 | </div> |
---|
2015 | <div id="changes.from.rfc.2616"> |
---|
2016 | <h2 id="rfc.section.A.2"><a href="#rfc.section.A.2">A.2</a> <a href="#changes.from.rfc.2616">Changes from RFC 2616</a></h2> |
---|
2017 | <p id="rfc.section.A.2.p.1">Clarify denial of service attack avoidance requirement. (<a href="#invalidation.after.updates.or.deletions" title="Invalidation After Updates or Deletions">Section 12</a>) |
---|
2018 | </p> |
---|
2019 | </div> |
---|
2020 | </div> |
---|
2021 | <div id="change.log"> |
---|
2022 | <h1 id="rfc.section.B"><a href="#rfc.section.B">B.</a> <a href="#change.log">Change Log (to be removed by RFC Editor before publication)</a></h1> |
---|
2023 | <div> |
---|
2024 | <h2 id="rfc.section.B.1"><a href="#rfc.section.B.1">B.1</a> Since RFC2616 |
---|
2025 | </h2> |
---|
2026 | <p id="rfc.section.B.1.p.1">Extracted relevant partitions from <a href="#RFC2616" id="rfc.xref.RFC2616.1"><cite title="Hypertext Transfer Protocol -- HTTP/1.1">[RFC2616]</cite></a>. |
---|
2027 | </p> |
---|
2028 | </div> |
---|
2029 | <div> |
---|
2030 | <h2 id="rfc.section.B.2"><a href="#rfc.section.B.2">B.2</a> Since draft-ietf-httpbis-p6-cache-00 |
---|
2031 | </h2> |
---|
2032 | <p id="rfc.section.B.2.p.1">Closed issues: </p> |
---|
2033 | <ul> |
---|
2034 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/9">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/9</a>>: "Trailer" (<<a href="http://purl.org/NET/http-errata#trailer-hop">http://purl.org/NET/http-errata#trailer-hop</a>>) |
---|
2035 | </li> |
---|
2036 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/12">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/12</a>>: "Invalidation after Update or Delete" (<<a href="http://purl.org/NET/http-errata#invalidupd">http://purl.org/NET/http-errata#invalidupd</a>>) |
---|
2037 | </li> |
---|
2038 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/35">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/35</a>>: "Normative and Informative references" |
---|
2039 | </li> |
---|
2040 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/48">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/48</a>>: "Date reference typo" |
---|
2041 | </li> |
---|
2042 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/49">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/49</a>>: "Connection header text" |
---|
2043 | </li> |
---|
2044 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/65">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/65</a>>: "Informative references" |
---|
2045 | </li> |
---|
2046 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/66">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/66</a>>: "ISO-8859-1 Reference" |
---|
2047 | </li> |
---|
2048 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/86">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/86</a>>: "Normative up-to-date references" |
---|
2049 | </li> |
---|
2050 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/87">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/87</a>>: "typo in 13.2.2" |
---|
2051 | </li> |
---|
2052 | </ul> |
---|
2053 | <p id="rfc.section.B.2.p.2">Other changes: </p> |
---|
2054 | <ul> |
---|
2055 | <li>Use names of RFC4234 core rules DQUOTE and HTAB (work in progress on <<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36</a>>) |
---|
2056 | </li> |
---|
2057 | </ul> |
---|
2058 | </div> |
---|
2059 | <div> |
---|
2060 | <h2 id="rfc.section.B.3"><a href="#rfc.section.B.3">B.3</a> Since draft-ietf-httpbis-p6-cache-01 |
---|
2061 | </h2> |
---|
2062 | <p id="rfc.section.B.3.p.1">Closed issues: </p> |
---|
2063 | <ul> |
---|
2064 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/82">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/82</a>>: "rel_path not used" |
---|
2065 | </li> |
---|
2066 | </ul> |
---|
2067 | <p id="rfc.section.B.3.p.2">Other changes: </p> |
---|
2068 | <ul> |
---|
2069 | <li>Get rid of duplicate BNF rule names ("host" -> "uri-host") (work in progress on <<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/36</a>>) |
---|
2070 | </li> |
---|
2071 | <li>Add explicit references to BNF syntax and rules imported from other parts of the specification.</li> |
---|
2072 | </ul> |
---|
2073 | </div> |
---|
2074 | <div id="changes.since.02"> |
---|
2075 | <h2 id="rfc.section.B.4"><a href="#rfc.section.B.4">B.4</a> <a href="#changes.since.02">Since draft-ietf-httpbis-p6-cache-02</a></h2> |
---|
2076 | <p id="rfc.section.B.4.p.1">Ongoing work on IANA Message Header Registration (<<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/40">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/40</a>>): |
---|
2077 | </p> |
---|
2078 | <ul> |
---|
2079 | <li>Reference RFC 3984, and update header registrations for headers defined in this document.</li> |
---|
2080 | </ul> |
---|
2081 | </div> |
---|
2082 | <div id="changes.since.03"> |
---|
2083 | <h2 id="rfc.section.B.5"><a href="#rfc.section.B.5">B.5</a> <a href="#changes.since.03">Since draft-ietf-httpbis-p6-cache-03</a></h2> |
---|
2084 | <p id="rfc.section.B.5.p.1">Closed issues: </p> |
---|
2085 | <ul> |
---|
2086 | <li><<a href="http://www3.tools.ietf.org/wg/httpbis/trac/ticket/106">http://www3.tools.ietf.org/wg/httpbis/trac/ticket/106</a>>: "Vary header classification" |
---|
2087 | </li> |
---|
2088 | </ul> |
---|
2089 | </div> |
---|
2090 | </div> |
---|
2091 | <h1 id="rfc.index"><a href="#rfc.index">Index</a></h1> |
---|
2092 | <p class="noprint"><a href="#rfc.index.A">A</a> <a href="#rfc.index.C">C</a> <a href="#rfc.index.E">E</a> <a href="#rfc.index.F">F</a> <a href="#rfc.index.G">G</a> <a href="#rfc.index.H">H</a> <a href="#rfc.index.I">I</a> <a href="#rfc.index.M">M</a> <a href="#rfc.index.N">N</a> <a href="#rfc.index.O">O</a> <a href="#rfc.index.P">P</a> <a href="#rfc.index.R">R</a> <a href="#rfc.index.S">S</a> <a href="#rfc.index.V">V</a> <a href="#rfc.index.W">W</a> |
---|
2093 | </p> |
---|
2094 | <div class="print2col"> |
---|
2095 | <ul class="ind"> |
---|
2096 | <li><a id="rfc.index.A" href="#rfc.index.A"><b>A</b></a><ul> |
---|
2097 | <li>age <a href="#rfc.iref.a.1">1.2</a></li> |
---|
2098 | <li>Age header <a href="#rfc.iref.a.2"><b>16.1</b></a>, <a href="#rfc.xref.header.age.1">17.1</a></li> |
---|
2099 | </ul> |
---|
2100 | </li> |
---|
2101 | <li><a id="rfc.index.C" href="#rfc.index.C"><b>C</b></a><ul> |
---|
2102 | <li>cache <a href="#rfc.iref.c.1">1.1</a></li> |
---|
2103 | <li>Cache Directives |
---|
2104 | <ul> |
---|
2105 | <li>max-age <a href="#rfc.iref.c.9"><b>16.2.3</b></a>, <a href="#rfc.iref.c.12"><b>16.2.4</b></a></li> |
---|
2106 | <li>max-stale <a href="#rfc.iref.c.11"><b>16.2.3</b></a></li> |
---|
2107 | <li>min-fresh <a href="#rfc.iref.c.10"><b>16.2.3</b></a></li> |
---|
2108 | <li>must-revalidate <a href="#rfc.iref.c.14"><b>16.2.4</b></a></li> |
---|
2109 | <li>no-cache <a href="#rfc.iref.c.6"><b>16.2.1</b></a></li> |
---|
2110 | <li>no-store <a href="#rfc.iref.c.7"><b>16.2.2</b></a></li> |
---|
2111 | <li>no-transform <a href="#rfc.iref.c.16"><b>16.2.5</b></a></li> |
---|
2112 | <li>only-if-cached <a href="#rfc.iref.c.13"><b>16.2.4</b></a></li> |
---|
2113 | <li>private <a href="#rfc.iref.c.5"><b>16.2.1</b></a></li> |
---|
2114 | <li>proxy-revalidate <a href="#rfc.iref.c.15"><b>16.2.4</b></a></li> |
---|
2115 | <li>public <a href="#rfc.iref.c.4"><b>16.2.1</b></a></li> |
---|
2116 | <li>s-maxage <a href="#rfc.iref.c.8"><b>16.2.3</b></a></li> |
---|
2117 | </ul> |
---|
2118 | </li> |
---|
2119 | <li>Cache-Control header <a href="#rfc.xref.header.cache-control.1">3.1</a>, <a href="#rfc.xref.header.cache-control.2">3.1</a>, <a href="#rfc.xref.header.cache-control.3">3.3</a>, <a href="#rfc.xref.header.cache-control.4">4.1</a>, <a href="#rfc.xref.header.cache-control.5">4.5</a>, <a href="#rfc.xref.header.cache-control.6">6</a>, <a href="#rfc.xref.header.cache-control.7">6</a>, <a href="#rfc.xref.header.cache-control.8">10</a>, <a href="#rfc.iref.c.3"><b>16.2</b></a>, <a href="#rfc.xref.header.cache-control.9">16.3</a>, <a href="#rfc.xref.header.cache-control.10">16.4</a>, <a href="#rfc.xref.header.cache-control.11">17.1</a>, <a href="#rfc.xref.header.cache-control.12">A.1</a></li> |
---|
2120 | <li>cacheable <a href="#rfc.iref.c.2">1.2</a></li> |
---|
2121 | </ul> |
---|
2122 | </li> |
---|
2123 | <li><a id="rfc.index.E" href="#rfc.index.E"><b>E</b></a><ul> |
---|
2124 | <li>Expires header <a href="#rfc.xref.header.expires.1">6</a>, <a href="#rfc.xref.header.expires.2">16.2.3</a>, <a href="#rfc.iref.e.2"><b>16.3</b></a>, <a href="#rfc.xref.header.expires.3">17.1</a></li> |
---|
2125 | <li>explicit expiration time <a href="#rfc.iref.e.1">1.2</a></li> |
---|
2126 | </ul> |
---|
2127 | </li> |
---|
2128 | <li><a id="rfc.index.F" href="#rfc.index.F"><b>F</b></a><ul> |
---|
2129 | <li>first-hand <a href="#rfc.iref.f.1">1.2</a></li> |
---|
2130 | <li>fresh <a href="#rfc.iref.f.3">1.2</a></li> |
---|
2131 | <li>freshness lifetime <a href="#rfc.iref.f.2">1.2</a></li> |
---|
2132 | </ul> |
---|
2133 | </li> |
---|
2134 | <li><a id="rfc.index.G" href="#rfc.index.G"><b>G</b></a><ul> |
---|
2135 | <li><tt>Grammar</tt> |
---|
2136 | <ul> |
---|
2137 | <li><tt>Age</tt> <a href="#rfc.iref.g.1"><b>16.1</b></a></li> |
---|
2138 | <li><tt>age-value</tt> <a href="#rfc.iref.g.2"><b>16.1</b></a></li> |
---|
2139 | <li><tt>Cache-Control</tt> <a href="#rfc.iref.g.4"><b>16.2</b></a></li> |
---|
2140 | <li><tt>cache-directive</tt> <a href="#rfc.iref.g.5"><b>16.2</b></a></li> |
---|
2141 | <li><tt>cache-extension</tt> <a href="#rfc.iref.g.8"><b>16.2</b></a></li> |
---|
2142 | <li><tt>cache-request-directive</tt> <a href="#rfc.iref.g.6"><b>16.2</b></a></li> |
---|
2143 | <li><tt>cache-response-directive</tt> <a href="#rfc.iref.g.7"><b>16.2</b></a></li> |
---|
2144 | <li><tt>delta-seconds</tt> <a href="#rfc.iref.g.3"><b>16.1</b></a></li> |
---|
2145 | <li><tt>Expires</tt> <a href="#rfc.iref.g.9"><b>16.3</b></a></li> |
---|
2146 | <li><tt>extension-pragma</tt> <a href="#rfc.iref.g.12"><b>16.4</b></a></li> |
---|
2147 | <li><tt>Pragma</tt> <a href="#rfc.iref.g.10"><b>16.4</b></a></li> |
---|
2148 | <li><tt>pragma-directive</tt> <a href="#rfc.iref.g.11"><b>16.4</b></a></li> |
---|
2149 | <li><tt>Vary</tt> <a href="#rfc.iref.g.13"><b>16.5</b></a></li> |
---|
2150 | <li><tt>warn-agent</tt> <a href="#rfc.iref.g.17"><b>16.6</b></a></li> |
---|
2151 | <li><tt>warn-code</tt> <a href="#rfc.iref.g.16"><b>16.6</b></a></li> |
---|
2152 | <li><tt>warn-date</tt> <a href="#rfc.iref.g.19"><b>16.6</b></a></li> |
---|
2153 | <li><tt>warn-text</tt> <a href="#rfc.iref.g.18"><b>16.6</b></a></li> |
---|
2154 | <li><tt>Warning</tt> <a href="#rfc.iref.g.14"><b>16.6</b></a></li> |
---|
2155 | <li><tt>warning-value</tt> <a href="#rfc.iref.g.15"><b>16.6</b></a></li> |
---|
2156 | </ul> |
---|
2157 | </li> |
---|
2158 | </ul> |
---|
2159 | </li> |
---|
2160 | <li><a id="rfc.index.H" href="#rfc.index.H"><b>H</b></a><ul> |
---|
2161 | <li>Headers |
---|
2162 | <ul> |
---|
2163 | <li>Age <a href="#rfc.iref.h.2"><b>16.1</b></a>, <a href="#rfc.xref.header.age.1">17.1</a></li> |
---|
2164 | <li>Cache-Control <a href="#rfc.xref.header.cache-control.1">3.1</a>, <a href="#rfc.xref.header.cache-control.2">3.1</a>, <a href="#rfc.xref.header.cache-control.3">3.3</a>, <a href="#rfc.xref.header.cache-control.4">4.1</a>, <a href="#rfc.xref.header.cache-control.5">4.5</a>, <a href="#rfc.xref.header.cache-control.6">6</a>, <a href="#rfc.xref.header.cache-control.7">6</a>, <a href="#rfc.xref.header.cache-control.8">10</a>, <a href="#rfc.iref.h.3"><b>16.2</b></a>, <a href="#rfc.xref.header.cache-control.9">16.3</a>, <a href="#rfc.xref.header.cache-control.10">16.4</a>, <a href="#rfc.xref.header.cache-control.11">17.1</a>, <a href="#rfc.xref.header.cache-control.12">A.1</a></li> |
---|
2165 | <li>Expires <a href="#rfc.xref.header.expires.1">6</a>, <a href="#rfc.xref.header.expires.2">16.2.3</a>, <a href="#rfc.iref.h.4"><b>16.3</b></a>, <a href="#rfc.xref.header.expires.3">17.1</a></li> |
---|
2166 | <li>Pragma <a href="#rfc.xref.header.pragma.1">16.2</a>, <a href="#rfc.iref.h.5"><b>16.4</b></a>, <a href="#rfc.xref.header.pragma.2">17.1</a></li> |
---|
2167 | <li>Vary <a href="#rfc.xref.header.vary.1">8</a>, <a href="#rfc.iref.h.6"><b>16.5</b></a>, <a href="#rfc.xref.header.vary.2">17.1</a></li> |
---|
2168 | <li>Warning <a href="#rfc.xref.header.warning.1">3.1</a>, <a href="#rfc.xref.header.warning.2">3.2</a>, <a href="#rfc.xref.header.warning.3">3.2</a>, <a href="#rfc.xref.header.warning.4">7.2</a>, <a href="#rfc.xref.header.warning.5">7.3</a>, <a href="#rfc.iref.h.7"><b>16.6</b></a>, <a href="#rfc.xref.header.warning.6">17.1</a>, <a href="#rfc.xref.header.warning.7">A.1</a></li> |
---|
2169 | </ul> |
---|
2170 | </li> |
---|
2171 | <li>heuristic expiration time <a href="#rfc.iref.h.1">1.2</a></li> |
---|
2172 | </ul> |
---|
2173 | </li> |
---|
2174 | <li><a id="rfc.index.I" href="#rfc.index.I"><b>I</b></a><ul> |
---|
2175 | <li><em>ISO-8859-1</em> <a href="#rfc.xref.ISO-8859-1.1">16.6</a>, <a href="#ISO-8859-1"><b>20.1</b></a></li> |
---|
2176 | </ul> |
---|
2177 | </li> |
---|
2178 | <li><a id="rfc.index.M" href="#rfc.index.M"><b>M</b></a><ul> |
---|
2179 | <li>max-age |
---|
2180 | <ul> |
---|
2181 | <li>Cache Directive <a href="#rfc.iref.m.1"><b>16.2.3</b></a>, <a href="#rfc.iref.m.4"><b>16.2.4</b></a></li> |
---|
2182 | </ul> |
---|
2183 | </li> |
---|
2184 | <li>max-stale |
---|
2185 | <ul> |
---|
2186 | <li>Cache Directive <a href="#rfc.iref.m.3"><b>16.2.3</b></a></li> |
---|
2187 | </ul> |
---|
2188 | </li> |
---|
2189 | <li>min-fresh |
---|
2190 | <ul> |
---|
2191 | <li>Cache Directive <a href="#rfc.iref.m.2"><b>16.2.3</b></a></li> |
---|
2192 | </ul> |
---|
2193 | </li> |
---|
2194 | <li>must-revalidate |
---|
2195 | <ul> |
---|
2196 | <li>Cache Directive <a href="#rfc.iref.m.5"><b>16.2.4</b></a></li> |
---|
2197 | </ul> |
---|
2198 | </li> |
---|
2199 | </ul> |
---|
2200 | </li> |
---|
2201 | <li><a id="rfc.index.N" href="#rfc.index.N"><b>N</b></a><ul> |
---|
2202 | <li>no-cache |
---|
2203 | <ul> |
---|
2204 | <li>Cache Directive <a href="#rfc.iref.n.1"><b>16.2.1</b></a></li> |
---|
2205 | </ul> |
---|
2206 | </li> |
---|
2207 | <li>no-store |
---|
2208 | <ul> |
---|
2209 | <li>Cache Directive <a href="#rfc.iref.n.2"><b>16.2.2</b></a></li> |
---|
2210 | </ul> |
---|
2211 | </li> |
---|
2212 | <li>no-transform |
---|
2213 | <ul> |
---|
2214 | <li>Cache Directive <a href="#rfc.iref.n.3"><b>16.2.5</b></a></li> |
---|
2215 | </ul> |
---|
2216 | </li> |
---|
2217 | </ul> |
---|
2218 | </li> |
---|
2219 | <li><a id="rfc.index.O" href="#rfc.index.O"><b>O</b></a><ul> |
---|
2220 | <li>only-if-cached |
---|
2221 | <ul> |
---|
2222 | <li>Cache Directive <a href="#rfc.iref.o.1"><b>16.2.4</b></a></li> |
---|
2223 | </ul> |
---|
2224 | </li> |
---|
2225 | </ul> |
---|
2226 | </li> |
---|
2227 | <li><a id="rfc.index.P" href="#rfc.index.P"><b>P</b></a><ul> |
---|
2228 | <li><em>Part1</em> <a href="#rfc.xref.Part1.1">2</a>, <a href="#rfc.xref.Part1.2">2</a>, <a href="#rfc.xref.Part1.3">2</a>, <a href="#rfc.xref.Part1.4">2</a>, <a href="#rfc.xref.Part1.5">2</a>, <a href="#rfc.xref.Part1.6">2</a>, <a href="#rfc.xref.Part1.7">2</a>, <a href="#rfc.xref.Part1.8">2</a>, <a href="#rfc.xref.Part1.9">2</a>, <a href="#rfc.xref.Part1.10">2</a>, <a href="#rfc.xref.Part1.11">2</a>, <a href="#rfc.xref.Part1.12">2</a>, <a href="#rfc.xref.Part1.13">4.3</a>, <a href="#rfc.xref.Part1.14">7.1</a>, <a href="#rfc.xref.Part1.15">7.2</a>, <a href="#rfc.xref.Part1.16">7.2</a>, <a href="#rfc.xref.Part1.17">8</a>, <a href="#rfc.xref.Part1.18">16.3</a>, <a href="#Part1"><b>20.1</b></a>, <a href="#rfc.xref.Part1.19">A.1</a><ul> |
---|
2229 | <li><em>Section 2.1</em> <a href="#rfc.xref.Part1.1">2</a></li> |
---|
2230 | <li><em>Section 2.2</em> <a href="#rfc.xref.Part1.2">2</a>, <a href="#rfc.xref.Part1.3">2</a>, <a href="#rfc.xref.Part1.4">2</a>, <a href="#rfc.xref.Part1.5">2</a>, <a href="#rfc.xref.Part1.6">2</a>, <a href="#rfc.xref.Part1.7">2</a></li> |
---|
2231 | <li><em>Section 3.2.1</em> <a href="#rfc.xref.Part1.10">2</a>, <a href="#rfc.xref.Part1.12">2</a></li> |
---|
2232 | <li><em>Section 3.3.1</em> <a href="#rfc.xref.Part1.9">2</a>, <a href="#rfc.xref.Part1.18">16.3</a></li> |
---|
2233 | <li><em>Section 4.2</em> <a href="#rfc.xref.Part1.8">2</a>, <a href="#rfc.xref.Part1.17">8</a></li> |
---|
2234 | <li><em>Section 4.4</em> <a href="#rfc.xref.Part1.15">7.2</a>, <a href="#rfc.xref.Part1.16">7.2</a></li> |
---|
2235 | <li><em>Section 8.1</em> <a href="#rfc.xref.Part1.14">7.1</a></li> |
---|
2236 | <li><em>Section 8.3</em> <a href="#rfc.xref.Part1.13">4.3</a></li> |
---|
2237 | <li><em>Section 8.9</em> <a href="#rfc.xref.Part1.11">2</a></li> |
---|
2238 | </ul> |
---|
2239 | </li> |
---|
2240 | <li><em>Part2</em> <a href="#rfc.xref.Part2.1">11</a>, <a href="#Part2"><b>20.1</b></a><ul> |
---|
2241 | <li><em>Section 8.1.1</em> <a href="#rfc.xref.Part2.1">11</a></li> |
---|
2242 | </ul> |
---|
2243 | </li> |
---|
2244 | <li><em>Part3</em> <a href="#rfc.xref.Part3.1">7.2</a>, <a href="#rfc.xref.Part3.2">8</a>, <a href="#Part3"><b>20.1</b></a>, <a href="#rfc.xref.Part3.3">A.1</a><ul> |
---|
2245 | <li><em>Section 4.2.2</em> <a href="#rfc.xref.Part3.1">7.2</a></li> |
---|
2246 | <li><em>Section 5.1</em> <a href="#rfc.xref.Part3.2">8</a></li> |
---|
2247 | </ul> |
---|
2248 | </li> |
---|
2249 | <li><em>Part4</em> <a href="#rfc.xref.Part4.1">5</a>, <a href="#Part4"><b>20.1</b></a></li> |
---|
2250 | <li><em>Part5</em> <a href="#rfc.xref.Part5.1">7.3</a>, <a href="#rfc.xref.Part5.2">10</a>, <a href="#Part5"><b>20.1</b></a>, <a href="#rfc.xref.Part5.3">A.1</a><ul> |
---|
2251 | <li><em>Section 5</em> <a href="#rfc.xref.Part5.1">7.3</a>, <a href="#rfc.xref.Part5.2">10</a></li> |
---|
2252 | </ul> |
---|
2253 | </li> |
---|
2254 | <li><em>Part7</em> <a href="#rfc.xref.Part7.1">6</a>, <a href="#rfc.xref.Part7.2">16.2.1</a>, <a href="#Part7"><b>20.1</b></a><ul> |
---|
2255 | <li><em>Section 4.1</em> <a href="#rfc.xref.Part7.1">6</a>, <a href="#rfc.xref.Part7.2">16.2.1</a></li> |
---|
2256 | </ul> |
---|
2257 | </li> |
---|
2258 | <li>Pragma header <a href="#rfc.xref.header.pragma.1">16.2</a>, <a href="#rfc.iref.p.4"><b>16.4</b></a>, <a href="#rfc.xref.header.pragma.2">17.1</a></li> |
---|
2259 | <li>private |
---|
2260 | <ul> |
---|
2261 | <li>Cache Directive <a href="#rfc.iref.p.2"><b>16.2.1</b></a></li> |
---|
2262 | </ul> |
---|
2263 | </li> |
---|
2264 | <li>proxy-revalidate |
---|
2265 | <ul> |
---|
2266 | <li>Cache Directive <a href="#rfc.iref.p.3"><b>16.2.4</b></a></li> |
---|
2267 | </ul> |
---|
2268 | </li> |
---|
2269 | <li>public |
---|
2270 | <ul> |
---|
2271 | <li>Cache Directive <a href="#rfc.iref.p.1"><b>16.2.1</b></a></li> |
---|
2272 | </ul> |
---|
2273 | </li> |
---|
2274 | </ul> |
---|
2275 | </li> |
---|
2276 | <li><a id="rfc.index.R" href="#rfc.index.R"><b>R</b></a><ul> |
---|
2277 | <li><em>RFC1305</em> <a href="#rfc.xref.RFC1305.1">4.3</a>, <a href="#RFC1305"><b>20.2</b></a></li> |
---|
2278 | <li><em>RFC2047</em> <a href="#rfc.xref.RFC2047.1">16.6</a>, <a href="#RFC2047"><b>20.1</b></a></li> |
---|
2279 | <li><em>RFC2119</em> <a href="#rfc.xref.RFC2119.1">1.3</a>, <a href="#RFC2119"><b>20.1</b></a></li> |
---|
2280 | <li><em>RFC2616</em> <a href="#RFC2616"><b>20.2</b></a>, <a href="#rfc.xref.RFC2616.1">B.1</a></li> |
---|
2281 | <li><em>RFC3864</em> <a href="#rfc.xref.RFC3864.1">17.1</a>, <a href="#RFC3864"><b>20.2</b></a></li> |
---|
2282 | </ul> |
---|
2283 | </li> |
---|
2284 | <li><a id="rfc.index.S" href="#rfc.index.S"><b>S</b></a><ul> |
---|
2285 | <li>s-maxage |
---|
2286 | <ul> |
---|
2287 | <li>Cache Directive <a href="#rfc.iref.s.3"><b>16.2.3</b></a></li> |
---|
2288 | </ul> |
---|
2289 | </li> |
---|
2290 | <li>semantically transparent <a href="#rfc.iref.s.1">1.1</a></li> |
---|
2291 | <li>stale <a href="#rfc.iref.s.2">1.2</a></li> |
---|
2292 | </ul> |
---|
2293 | </li> |
---|
2294 | <li><a id="rfc.index.V" href="#rfc.index.V"><b>V</b></a><ul> |
---|
2295 | <li>validator <a href="#rfc.iref.v.1">1.2</a></li> |
---|
2296 | <li>Vary header <a href="#rfc.xref.header.vary.1">8</a>, <a href="#rfc.iref.v.2"><b>16.5</b></a>, <a href="#rfc.xref.header.vary.2">17.1</a></li> |
---|
2297 | </ul> |
---|
2298 | </li> |
---|
2299 | <li><a id="rfc.index.W" href="#rfc.index.W"><b>W</b></a><ul> |
---|
2300 | <li>Warning header <a href="#rfc.xref.header.warning.1">3.1</a>, <a href="#rfc.xref.header.warning.2">3.2</a>, <a href="#rfc.xref.header.warning.3">3.2</a>, <a href="#rfc.xref.header.warning.4">7.2</a>, <a href="#rfc.xref.header.warning.5">7.3</a>, <a href="#rfc.iref.w.1"><b>16.6</b></a>, <a href="#rfc.xref.header.warning.6">17.1</a>, <a href="#rfc.xref.header.warning.7">A.1</a></li> |
---|
2301 | </ul> |
---|
2302 | </li> |
---|
2303 | </ul> |
---|
2304 | </div> |
---|
2305 | <div class="avoidbreak"> |
---|
2306 | <h1 id="rfc.authors"><a href="#rfc.authors">Authors' Addresses</a></h1> |
---|
2307 | <p><b>Roy T. Fielding</b> |
---|
2308 | (editor) |
---|
2309 | <br>Day Software<br>23 Corporate Plaza DR, Suite 280<br>Newport Beach, CA 92660<br>USA<br>Phone: <a href="tel:+1-949-706-5300">+1-949-706-5300</a><br>Fax: <a href="fax:+1-949-706-5305">+1-949-706-5305</a><br>EMail: <a href="mailto:fielding@gbiv.com">fielding@gbiv.com</a><br>URI: <a href="http://roy.gbiv.com/">http://roy.gbiv.com/</a></p> |
---|
2310 | <p><b>Jim Gettys</b><br>One Laptop per Child<br>21 Oak Knoll Road<br>Carlisle, MA 01741<br>USA<br>EMail: <a href="mailto:jg@laptop.org">jg@laptop.org</a><br>URI: <a href="http://www.laptop.org/">http://www.laptop.org/</a></p> |
---|
2311 | <p><b>Jeffrey C. Mogul</b><br>Hewlett-Packard Company<br>HP Labs, Large Scale Systems Group<br>1501 Page Mill Road, MS 1177<br>Palo Alto, CA 94304<br>USA<br>EMail: <a href="mailto:JeffMogul@acm.org">JeffMogul@acm.org</a></p> |
---|
2312 | <p><b>Henrik Frystyk Nielsen</b><br>Microsoft Corporation<br>1 Microsoft Way<br>Redmond, WA 98052<br>USA<br>EMail: <a href="mailto:henrikn@microsoft.com">henrikn@microsoft.com</a></p> |
---|
2313 | <p><b>Larry Masinter</b><br>Adobe Systems, Incorporated<br>345 Park Ave<br>San Jose, CA 95110<br>USA<br>EMail: <a href="mailto:LMM@acm.org">LMM@acm.org</a><br>URI: <a href="http://larry.masinter.net/">http://larry.masinter.net/</a></p> |
---|
2314 | <p><b>Paul J. Leach</b><br>Microsoft Corporation<br>1 Microsoft Way<br>Redmond, WA 98052<br>EMail: <a href="mailto:paulle@microsoft.com">paulle@microsoft.com</a></p> |
---|
2315 | <p><b>Tim Berners-Lee</b><br>World Wide Web Consortium<br>MIT Computer Science and Artificial Intelligence Laboratory<br>The Stata Center, Building 32<br>32 Vassar Street<br>Cambridge, MA 02139<br>USA<br>EMail: <a href="mailto:timbl@w3.org">timbl@w3.org</a><br>URI: <a href="http://www.w3.org/People/Berners-Lee/">http://www.w3.org/People/Berners-Lee/</a></p> |
---|
2316 | <p><b>Yves Lafon</b> |
---|
2317 | (editor) |
---|
2318 | <br>World Wide Web Consortium<br>W3C / ERCIM<br>2004, rte des Lucioles<br>Sophia-Antipolis, AM 06902<br>France<br>EMail: <a href="mailto:ylafon@w3.org">ylafon@w3.org</a><br>URI: <a href="http://www.raubacapeu.net/people/yves/">http://www.raubacapeu.net/people/yves/</a></p> |
---|
2319 | <p><b>Julian F. Reschke</b> |
---|
2320 | (editor) |
---|
2321 | <br>greenbytes GmbH<br>Hafenweg 16<br>Muenster, NW 48155<br>Germany<br>Phone: <a href="tel:+492512807760">+49 251 2807760</a><br>Fax: <a href="fax:+492512807761">+49 251 2807761</a><br>EMail: <a href="mailto:julian.reschke@greenbytes.de">julian.reschke@greenbytes.de</a><br>URI: <a href="http://greenbytes.de/tech/webdav/">http://greenbytes.de/tech/webdav/</a></p> |
---|
2322 | </div> |
---|
2323 | <div id="rfc.copyright"> |
---|
2324 | <h1><a href="#rfc.copyright">Full Copyright Statement</a></h1> |
---|
2325 | <p>Copyright © The IETF Trust (2008).</p> |
---|
2326 | <p>This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the |
---|
2327 | authors retain all their rights. |
---|
2328 | </p> |
---|
2329 | <p>This document and the information contained herein are provided on an “AS IS” basis and THE CONTRIBUTOR, THE ORGANIZATION |
---|
2330 | HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE |
---|
2331 | DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN |
---|
2332 | WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. |
---|
2333 | </p> |
---|
2334 | </div> |
---|
2335 | <div id="rfc.ipr"> |
---|
2336 | <h1><a href="#rfc.ipr">Intellectual Property</a></h1> |
---|
2337 | <p>The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might |
---|
2338 | be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any |
---|
2339 | license under such rights might or might not be available; nor does it represent that it has made any independent effort to |
---|
2340 | identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and |
---|
2341 | BCP 79. |
---|
2342 | </p> |
---|
2343 | <p>Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result |
---|
2344 | of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users |
---|
2345 | of this specification can be obtained from the IETF on-line IPR repository at <a href="http://www.ietf.org/ipr">http://www.ietf.org/ipr</a>. |
---|
2346 | </p> |
---|
2347 | <p>The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary |
---|
2348 | rights that may cover technology that may be required to implement this standard. Please address the information to the IETF |
---|
2349 | at <a href="mailto:ietf-ipr@ietf.org">ietf-ipr@ietf.org</a>. |
---|
2350 | </p> |
---|
2351 | </div> |
---|
2352 | </body> |
---|
2353 | </html> |
---|