idnits 2.17.1 draft-ietf-httpbis-cache-header-03.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 (March 1, 2020) is 1517 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 318 -- Looks like a reference, but probably isn't: '2' on line 320 -- Looks like a reference, but probably isn't: '3' on line 322 == Outdated reference: A later version (-19) exists of draft-ietf-httpbis-header-structure-13 Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 4 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 March 1, 2020 5 Expires: September 2, 2020 7 The Cache-Status HTTP Response Header Field 8 draft-ietf-httpbis-cache-header-03 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 September 2, 2020. 45 Copyright Notice 47 Copyright (c) 2020 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 Field . . . . . . . . . 3 65 2.1. The hit parameter . . . . . . . . . . . . . . . . . . . . 4 66 2.2. The fwd parameter . . . . . . . . . . . . . . . . . . . . 4 67 2.3. The fwd-status parameter . . . . . . . . . . . . . . . . 5 68 2.4. The ttl parameter . . . . . . . . . . . . . . . . . . . . 5 69 2.5. The stored parameter . . . . . . . . . . . . . . . . . . 5 70 2.6. The collapsed parameter . . . . . . . . . . . . . . . . . 5 71 2.7. The key parameter . . . . . . . . . . . . . . . . . . . . 5 72 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 5 73 4. Security Considerations . . . . . . . . . . . . . . . . . . . 6 74 5. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 75 5.1. Normative References . . . . . . . . . . . . . . . . . . 7 76 5.2. Informative References . . . . . . . . . . . . . . . . . 7 77 5.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 7 78 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 80 1. Introduction 82 To aid debugging, HTTP caches often append headers to a response 83 detailing how they handled the request. 85 Unfortunately, the semantics of these headers are often unclear, and 86 both the semantics and syntax used vary greatly between 87 implementations. 89 This specification defines a single, new HTTP response header field, 90 "Cache-Status" for this purpose. 92 1.1. Notational Conventions 94 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 95 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 96 "OPTIONAL" in this document are to be interpreted as described in BCP 97 14 [RFC2119] [RFC8174] when, and only when, they appear in all 98 capitals, as shown here. 100 This document uses ABNF as defined in [RFC5234], along with the "%s" 101 extension for case sensitivity defined in [RFC7405]. 103 2. The Cache-Status HTTP Response Header Field 105 The Cache-Status HTTP response header indicates caches' handling of 106 the request corresponding to the response it occurs within. 108 Its value is a List [I-D.ietf-httpbis-header-structure]: 110 Cache-Status = sh-list 112 Each member of the list represents a cache that has handled the 113 request. The first member of the list represents the cache closest 114 to the origin server, and the last member of the list represents the 115 cache closest to the client (possibly including the user agent's 116 cache itself, if it chooses to append a value). 118 Caches determine when it is appropriate to add the Cache-Status 119 header field to a response. Some might decide to add it to all 120 responses, whereas others might only do so when specifically 121 configured to, or when the request contains a header that activates a 122 debugging mode. 124 When adding a value to the Cache-Status header field, caches SHOULD 125 preserve the existing contents of the header, to allow debugging of 126 the entire chain of caches handling the request. 128 Each list member identifies the cache that inserted that value, and 129 MUST have a type of either sh-string or sh-token. Depending on the 130 deployment, this might be a product or service name (e.g., 131 ExampleCache or "Example CDN"), a hostname ("cache-3.example.com"), 132 and IP address, or a generated string. 134 Each member of the list can also have parameters that describe that 135 cache's handling of the request. While all of these parameters are 136 OPTIONAL, caches are encouraged to provide as much information as 137 possible. 139 This specification defines these parameters: 141 hit = sh-boolean 142 fwd = sh-token 143 fwd-status = sh-integer 144 ttl = sh-integer 145 stored = sh-boolean 146 collapsed = sh-boolean 147 key = sh-string 149 2.1. The hit parameter 151 "hit", when true, indicates that the request was satisfied by the 152 cache; i.e., it did not go forward, and the response was obtained 153 from the cache (possibly with modifications; e.g., if the request was 154 conditional, a 304 Not Modified could be generated from cache). 156 "hit" and "fwd" are exclusive; only one of them should appear on each 157 list member. 159 2.2. The fwd parameter 161 "fwd" indicates why the request went forward. 163 It can have one of the following values: 165 o uri-miss - The cache did not contain any responses that matched 166 the request URI 168 o vary-miss - The cache contained a response that matched the 169 request URI, but could not select a response based upon this 170 request's headers and stored Vary headers. 172 o miss - The cache did not contain any responses that could be used 173 to satisfy this request (to be used when an implementation cannot 174 distinguish between uri-miss and vary-miss) 176 o stale - The cache was able to select a response for the request, 177 but it was stale 179 o request - The cache was able to select a fresh response for the 180 request, but client request headers (e.g., Cache-Control request 181 directives) did not allow its use 183 o bypass - The cache was configured to not handle this request 185 2.3. The fwd-status parameter 187 "fwd-status" indicates what status code the next hop server returned 188 in response to the request. Only meaningful when "fwd" is present; 189 if "fwd-status" is not present but "fwd" is, it defaults to the 190 status code sent in the response. 192 This parameter is useful to distinguish cases when the next hop 193 server sends a 304 Not Modified response to a conditional request, or 194 a 206 Partial Response due to a range request. 196 2.4. The ttl parameter 198 "ttl" indicates the response's remaining freshness lifetime as 199 calculated by the cache, as an integer number of seconds, measured 200 when the response is sent by the cache. This includes freshness 201 assigned by the cache; e.g., through heuristics, local configuration, 202 or other factors. May be negative, to indicate staleness. 204 2.5. The stored parameter 206 "stored" indicates whether the cache stored the forward response; a 207 true value indicates that it did. Only meaningful when fwd is 208 present. 210 2.6. The collapsed parameter 212 "collapsed" indicates whether this request was collapsed together 213 with one or more other forward requests; if true, the response was 214 successfully reused; if not, a new request had to be made. If not 215 present, the request was not collapsed with others. Only meaningful 216 when fwd is present. 218 2.7. The key parameter 220 "key" conveys a representation of the cache key used for the 221 response. Note that this may be implementation-specific. 223 3. Examples 225 The most minimal cache hit: 227 Cache-Status: ExampleCache; hit 229 ... but a polite cache will give some more information, e.g.: 231 Cache-Status: ExampleCache; hit; ttl=376 232 A stale hit just has negative freshness: 234 Cache-Status: ExampleCache; hit; ttl=-412 236 Whereas a complete miss is: 238 Cache-Status: ExampleCache; fwd=uri-miss 240 A miss that successfully validated on the back-end server: 242 Cache-Status: ExampleCache; fwd=stale; fwd-status=304 244 A miss that was collapsed with another request: 246 Cache-Status: ExampleCache; fwd=uri-miss; collapsed 248 A miss that the cache attempted to collapse, but couldn't: 250 Cache-Status: ExampleCache; fwd=uri-miss; collapsed=?0 252 Going through two layers of caching, both of which were hits, and the 253 second collapsed with other requests: 255 Cache-Status: OriginCache; hit; ttl=1100; collapsed, 256 "CDN Company Here"; hit; ttl=545 258 4. Security Considerations 260 Information about a cache's content can be used to infer the activity 261 of those using it. Generally, access to sensitive information in a 262 cache is limited to those who are authorised to access that 263 information (using a variety of techniques), so this does not 264 represent an attack vector in the general sense. 266 However, if the Cache-Status header is exposed to parties who are not 267 authorised to obtain the response it occurs within, it could expose 268 information about that data. 270 For example, if an attacker were able to obtain the Cache-Status 271 header from a response containing sensitive information and access 272 were limited to one person (or limited set of people), they could 273 determine whether that information had been accessed before. This is 274 similar to the information exposed by various timing attacks, but is 275 arguably more reliable, since the cache is directly reporting its 276 state. 278 Mitigations include use of encryption (e.g., TLS [RFC8446])) to 279 protect the response, and careful controls over access to response 280 headers (as are present in the Web platform). When in doubt, the 281 Cache-Status header field can be omitted. 283 5. References 285 5.1. Normative References 287 [I-D.ietf-httpbis-header-structure] 288 Nottingham, M. and P. Kamp, "Structured Headers for HTTP", 289 draft-ietf-httpbis-header-structure-13 (work in progress), 290 August 2019. 292 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 293 Requirement Levels", BCP 14, RFC 2119, 294 DOI 10.17487/RFC2119, March 1997, 295 . 297 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 298 Specifications: ABNF", STD 68, RFC 5234, 299 DOI 10.17487/RFC5234, January 2008, 300 . 302 [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", 303 RFC 7405, DOI 10.17487/RFC7405, December 2014, 304 . 306 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 307 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 308 May 2017, . 310 5.2. Informative References 312 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 313 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 314 . 316 5.3. URIs 318 [1] https://lists.w3.org/Archives/Public/ietf-http-wg/ 320 [2] https://httpwg.org/ 322 [3] https://github.com/httpwg/http-extensions/labels/cache-header 324 Author's Address 326 Mark Nottingham 327 Fastly 329 Email: mnot@mnot.net 330 URI: https://www.mnot.net/