idnits 2.17.1 draft-ietf-httpbis-cache-header-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The abstract seems to contain references ([2], [3], [1]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (November 4, 2019) is 1606 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 343 -- Looks like a reference, but probably isn't: '2' on line 345 -- Looks like a reference, but probably isn't: '3' on line 347 == Outdated reference: A later version (-19) exists of draft-ietf-httpbis-cache-05 -- Possible downref: Normative reference to a draft: ref. 'I-D.ietf-httpbis-cache' == Outdated reference: A later version (-19) exists of draft-ietf-httpbis-header-structure-13 Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 HTTP M. Nottingham 3 Internet-Draft Fastly 4 Intended status: Standards Track November 4, 2019 5 Expires: May 7, 2020 7 The Cache-Status HTTP Response Header 8 draft-ietf-httpbis-cache-header-02 10 Abstract 12 To aid debugging, HTTP caches often append headers to a response 13 detailing how they handled the request. This specification codifies 14 that practice and updates it for HTTP's current caching model. 16 Note to Readers 18 _RFC EDITOR: please remove this section before publication_ 20 Discussion of this draft takes place on the HTTP working group 21 mailing list (ietf-http-wg@w3.org), which is archived at 22 https://lists.w3.org/Archives/Public/ietf-http-wg/ [1]. 24 Working Group information can be found at https://httpwg.org/ [2]; 25 source code and issues list for this draft can be found at 26 https://github.com/httpwg/http-extensions/labels/cache-header [3]. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at https://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on May 7, 2020. 45 Copyright Notice 47 Copyright (c) 2019 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (https://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 63 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 64 2. The Cache-Status HTTP Response Header . . . . . . . . . . . . 3 65 2.1. The fwd parameter . . . . . . . . . . . . . . . . . . . . 4 66 2.2. The fwd-res parameter . . . . . . . . . . . . . . . . . . 4 67 2.3. The fwd-stored parameter . . . . . . . . . . . . . . . . 5 68 2.4. The res-fresh parameter . . . . . . . . . . . . . . . . . 5 69 2.5. The cache-fresh parameter . . . . . . . . . . . . . . . . 5 70 2.6. The collapse-hit parameter . . . . . . . . . . . . . . . 5 71 2.7. The collapse-wait parameter . . . . . . . . . . . . . . . 5 72 2.8. The key parameter . . . . . . . . . . . . . . . . . . . . 6 73 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 6 74 4. Security Considerations . . . . . . . . . . . . . . . . . . . 7 75 5. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 76 5.1. Normative References . . . . . . . . . . . . . . . . . . 7 77 5.2. Informative References . . . . . . . . . . . . . . . . . 8 78 5.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 8 79 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 81 1. Introduction 83 To aid debugging, HTTP caches often append headers to a response 84 detailing how they handled the request. 86 Unfortunately, the semantics of these headers are often unclear, and 87 both the semantics and syntax used vary greatly between 88 implementations. 90 This specification defines a single, new HTTP response header field, 91 "Cache-Status" for this purpose. 93 1.1. Notational Conventions 95 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 96 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 97 "OPTIONAL" in this document are to be interpreted as described in BCP 98 14 [RFC2119] [RFC8174] when, and only when, they appear in all 99 capitals, as shown here. 101 This document uses ABNF as defined in [RFC5234], along with the "%s" 102 extension for case sensitivity defined in [RFC7405]. 104 2. The Cache-Status HTTP Response Header 106 The Cache-Status HTTP response header indicates caches' handling of 107 the request corresponding to the response it occurs within. 109 Its value is a List [I-D.ietf-httpbis-header-structure]: 111 Cache-Status = sh-list 113 Each member of the parameterised list represents a cache that has 114 handled the request. The first member of the list represents the 115 cache closest to the origin server, and the last member of the list 116 represents the cache closest to the user agent (possibly including 117 the user agent's cache itself, if it chooses to append a value). 119 Caches determine when it is appropriate to add the Cache-Status 120 header field to a response. Some might decide to add it to all 121 responses, whereas others might only do so when specifically 122 configured to, or when the request contains a header that activates a 123 debugging mode. 125 When adding a value to the Cache-Status header field, caches SHOULD 126 preserve the existing contents of the header, to allow debugging of 127 the entire chain of caches handling the request. 129 The list members identify the cache that inserted the value, and MUST 130 have a type of either sh-string or sh-token. Depending on the 131 deployment, this might be a product or service name (e.g., 132 ExampleCache or "Example CDN"), a hostname ("cache-3.example.com"), 133 and IP address, or a generated string. 135 Each member of the list can also have a number of parameters that 136 describe that cache's handling of the request. While all of these 137 parameters are OPTIONAL, caches are encouraged to provide as much 138 information as possible. 140 fwd = sh-token 141 fwd-res = sh-token 142 fwd-stored = sh-boolean 143 res-fresh = sh-integer 144 cache-fresh = sh-integer 145 collapse-hit = sh-boolean 146 collapse-wait = sh-integer 147 key = sh-string 149 2.1. The fwd parameter 151 "fwd" indicates why the request went forward. If it is not present, 152 the value defaults to "none". 154 It can have one of the following values: 156 o none - The request did not go forward; i.e., it was a hit, and was 157 served from the cache. 159 o bypass - The cache was configured to not handle this request 161 o uri-miss - The cache did not contain any responses that matched 162 the request URI 164 o vary-miss - The cache contained a response that matched the 165 request URI, but could not select a response based upon this 166 request's headers. 168 o miss - The cache did not contain any responses that could be used 169 to satisfy this request (to be used when an implementation cannot 170 distinguish between uri-miss and vary-miss) 172 o res-stale - The cache was able to select a response for the 173 request, but it was stale 175 o req-stale - The cache was able to select a fresh response for the 176 request, but client request headers (e.g., Cache-Control request 177 directives) did not allow its use 179 2.2. The fwd-res parameter 181 "fwd-res" indicates what the result of the forward request was. It 182 is only valid when fwd is "res-stale" or "req-stale", and defaults to 183 "full" if not present when fwd is one of those values. 185 It can have one of the following values: 187 o full - indicates that the response was a complete response (any 188 status code except 304 Not Modified and 206 Partial Response) 190 o partial - indicates that the response was a 206 Partial Response 192 o notmod - indicates that the response was a 304 Not Modified 194 2.3. The fwd-stored parameter 196 "fwd-stored" indicates whether the cache stored the response; a true 197 value indicates that it did. Only valid when fwd is not "none". 199 2.4. The res-fresh parameter 201 "res-fresh" indicates the response's remaining freshness lifetime (as 202 per [I-D.ietf-httpbis-cache], Section 4.2.1), as an integer number of 203 seconds. This does not include freshness assigned by the cache (see 204 "cache-fresh"). May be negative, to indicate staleness. 206 2.5. The cache-fresh parameter 208 "cache-fresh" indicates the response's remaining freshness lifetime 209 as calculated by the cache, as an integer number of seconds. This 210 includes freshness assigned by the cache; e.g., through heuristics, 211 local configuration, or other factors. May be negative, to indicate 212 staleness. 214 If both cache-fresh and res-fresh appear as parameters on the same 215 value, it implies that the cache freshness overrode the response 216 freshness. 218 2.6. The collapse-hit parameter 220 "collapse-hit" indicates whether this request was collapsed together 221 with one or more other forward requests; if true, the response was 222 successfully reused; if not, a new request had to be made. If not 223 present, the request was not collapsed with others. 225 2.7. The collapse-wait parameter 227 "collapse-wait" indicates the amount of time that the cache held the 228 request while waiting to see if it could be successfully collapsed, 229 as an integer number of milliseconds. 231 2.8. The key parameter 233 "key" conveys a representation of the cache key used for the 234 response. Note that this may be implementation-specific. 236 3. Examples 238 The most minimal cache hit: 240 Cache-Status: ExampleCache 242 ... but a polite cache will give some more information, e.g.: 244 Cache-Status: ExampleCache; res-fresh=376 246 A "negative" hit (i.e., the cache imposed its own freshness 247 lifetime): 249 Cache-Status: ExampleCache; cache-fresh=415 251 A stale hit just has negative freshness: 253 Cache-Status: ExampleCache; res-fresh=-412 255 Whereas a complete miss is: 257 Cache-Status: ExampleCache; fwd=uri-miss 259 A miss that validated on the back-end server: 261 Cache-Status: ExampleCache; fwd=res-stale; fwd-res=notmod 263 A miss that was collapsed with another request: 265 Cache-Status: ExampleCache; fwd=uri-miss; collapse-hit=?1 267 A miss that the cache attempted to collapse, but couldn't: 269 Cache-Status: ExampleCache; fwd=uri-miss; 270 collapse-hit=?0; collapse-wait=240 272 Going through two layers of caching, both of which were hits, and the 273 second collapsed with other requests: 275 Cache-Status: "CDN Company Here"; res-fresh=545, 276 OriginCache; cache-fresh=1100; collapse-hit=?1 278 4. Security Considerations 280 Information about a cache's content can be used to infer the activity 281 of those using it. Generally, access to sensitive information in a 282 cache is limited to those who are authorised to access that 283 information (using a variety of techniques), so this does not 284 represent an attack vector in the general sense. 286 However, if the Cache-Status header is exposed to parties who are not 287 authorised to obtain the response it occurs within, it could expose 288 information about that data. 290 For example, if an attacker were able to obtain the Cache-Status 291 header from a response containing sensitive information and access 292 were limited to one person (or limited set of people), they could 293 determine whether that information had been accessed before. This is 294 similar to the information exposed by various timing attacks, but is 295 arguably more reliable, since the cache is directly reporting its 296 state. 298 Mitigations include use of encryption (e.g., TLS [RFC8446])) to 299 protect the response, and careful controls over access to response 300 headers (as are present in the Web platform). When in doubt, the 301 Cache-Status header field can be omitted. 303 5. References 305 5.1. Normative References 307 [I-D.ietf-httpbis-cache] 308 Fielding, R., Nottingham, M., and J. Reschke, "HTTP 309 Caching", draft-ietf-httpbis-cache-05 (work in progress), 310 July 2019. 312 [I-D.ietf-httpbis-header-structure] 313 Nottingham, M. and P. Kamp, "Structured Headers for HTTP", 314 draft-ietf-httpbis-header-structure-13 (work in progress), 315 August 2019. 317 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 318 Requirement Levels", BCP 14, RFC 2119, 319 DOI 10.17487/RFC2119, March 1997, 320 . 322 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 323 Specifications: ABNF", STD 68, RFC 5234, 324 DOI 10.17487/RFC5234, January 2008, 325 . 327 [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", 328 RFC 7405, DOI 10.17487/RFC7405, December 2014, 329 . 331 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 332 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 333 May 2017, . 335 5.2. Informative References 337 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 338 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 339 . 341 5.3. URIs 343 [1] https://lists.w3.org/Archives/Public/ietf-http-wg/ 345 [2] https://httpwg.org/ 347 [3] https://github.com/httpwg/http-extensions/labels/cache-header 349 Author's Address 351 Mark Nottingham 352 Fastly 354 Email: mnot@mnot.net 355 URI: https://www.mnot.net/