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