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