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