idnits 2.17.1 draft-ietf-httpbis-cache-header-01.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 2, 2019) is 1636 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 328 -- Looks like a reference, but probably isn't: '2' on line 330 -- Looks like a reference, but probably isn't: '3' on line 332 == 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 2, 2019 5 Expires: May 5, 2020 7 The Cache-Status HTTP Response Header 8 draft-ietf-httpbis-cache-header-01 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 5, 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 . . . . . . . . . . . . . . . . 4 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 . . . . . . . . . . . . . . . . . . . . 5 73 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 5 74 4. Security Considerations . . . . . . . . . . . . . . . . . . . 6 75 5. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 76 5.1. Normative References . . . . . . . . . . . . . . . . . . 7 77 5.2. Informative References . . . . . . . . . . . . . . . . . 7 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: * none - The request did not 155 go forward; i.e., it was a hit, and was served from the cache. * 156 bypass - The cache was configured to not handle this request * uri- 157 miss - The cache did not contain any responses that matched the 158 request URI * vary-miss - The cache contained a response that matched 159 the request URI, but could not select a response based upon this 160 request's headers. * miss - The cache did not contain any responses 161 that could be used to satisfy this request (to be used when an 162 implementation cannot distinguish between uri-miss and vary-miss) * 163 res-stale - The cache was able to select a response for the request, 164 but it was stale * req-stale - The cache was able to select a fresh 165 response for the request, but client request headers (e.g., Cache- 166 Control request directives) did not allow its use 168 2.2. The fwd-res parameter 170 "fwd-res" indicates what the result of the forward request was. It 171 is only valid when fwd is "res-stale" or "req-stale", and defaults to 172 "full" if not present when fwd is one of those values. 174 It can have one of the following values: * full - indicates that the 175 response was a complete response (any status code except 304 Not 176 Modified and 206 Partial Response) * partial - indicates that the 177 response was a 206 Partial Response * notmod - indicates that the 178 response was a 304 Not Modified 180 2.3. The fwd-stored parameter 182 "fwd-stored" indicates whether the cache stored the response; a true 183 value indicates that it did. Only valid when fwd is not "none". 185 2.4. The res-fresh parameter 187 "res-fresh" indicates the response's remaining freshness lifetime (as 188 per [I-D.ietf-httpbis-cache], Section 4.2.1), as an integer number of 189 seconds. This does not include freshness assigned by the cache (see 190 "cache-fresh"). May be negative, to indicate staleness. 192 2.5. The cache-fresh parameter 194 "cache-fresh" indicates the response's remaining freshness lifetime 195 as calculated by the cache, as an integer number of seconds. This 196 includes freshness assigned by the cache; e.g., through heuristics, 197 local configuration, or other factors. May be negative, to indicate 198 staleness. 200 If both cache-fresh and res-fresh appear as parameters on the same 201 value, it implies that the cache freshness overrode the response 202 freshness. 204 2.6. The collapse-hit parameter 206 "collapse-hit" indicates whether this request was collapsed together 207 with one or more other forward requests; if true, the response was 208 successfully reused; if not, a new request had to be made. If not 209 present, the request was not collapsed with others. 211 2.7. The collapse-wait parameter 213 "collapse-wait" indicates the amount of time that the cache held the 214 request while waiting to see if it could be successfully collapsed, 215 as an integer number of milliseconds. 217 2.8. The key parameter 219 "key" conveys a representation of the cache key used for the 220 response. Note that this may be implementation-specific. 222 3. Examples 224 The most minimal cache hit: 226 Cache-Status: ExampleCache 228 ... but a polite cache will give some more information, e.g.: 230 Cache-Status: ExampleCache; res-fresh=376 231 A "negative" hit (i.e., the cache imposed its own freshness 232 lifetime): 234 Cache-Status: ExampleCache; cache-fresh=415 236 A stale hit just has negative freshness: 238 Cache-Status: ExampleCache; res-fresh=-412 240 Whereas a complete miss is: 242 Cache-Status: ExampleCache; fwd=uri-miss 244 A miss that validated on the back-end server: 246 Cache-Status: ExampleCache; fwd=res-stale; fwd-res=notmod 248 A miss that was collapsed with another request: 250 Cache-Status: ExampleCache; fwd=uri-miss; collapse-hit=?1 252 A miss that the cache attempted to collapse, but couldn't: 254 Cache-Status: ExampleCache; fwd=uri-miss; 255 collapse-hit=?0; collapse-wait=240 257 Going through two layers of caching, both of which were hits, and the 258 second collapsed with other requests: 260 Cache-Status: "CDN Company Here"; res-fresh=545, 261 OriginCache; cache-fresh=1100; collapse-hit=?1 263 4. Security Considerations 265 Information about a cache's content can be used to infer the activity 266 of those using it. Generally, access to sensitive information in a 267 cache is limited to those who are authorised to access that 268 information (using a variety of techniques), so this does not 269 represent an attack vector in the general sense. 271 However, if the Cache-Status header is exposed to parties who are not 272 authorised to obtain the response it occurs within, it could expose 273 information about that data. 275 For example, if an attacker were able to obtain the Cache-Status 276 header from a response containing sensitive information and access 277 were limited to one person (or limited set of people), they could 278 determine whether that information had been accessed before. This is 279 similar to the information exposed by various timing attacks, but is 280 arguably more reliable, since the cache is directly reporting its 281 state. 283 Mitigations include use of encryption (e.g., TLS [RFC8446])) to 284 protect the response, and careful controls over access to response 285 headers (as are present in the Web platform). When in doubt, the 286 Cache-Status header field can be omitted. 288 5. References 290 5.1. Normative References 292 [I-D.ietf-httpbis-cache] 293 Fielding, R., Nottingham, M., and J. Reschke, "HTTP 294 Caching", draft-ietf-httpbis-cache-05 (work in progress), 295 July 2019. 297 [I-D.ietf-httpbis-header-structure] 298 Nottingham, M. and P. Kamp, "Structured Headers for HTTP", 299 draft-ietf-httpbis-header-structure-13 (work in progress), 300 August 2019. 302 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 303 Requirement Levels", BCP 14, RFC 2119, 304 DOI 10.17487/RFC2119, March 1997, 305 . 307 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 308 Specifications: ABNF", STD 68, RFC 5234, 309 DOI 10.17487/RFC5234, January 2008, 310 . 312 [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", 313 RFC 7405, DOI 10.17487/RFC7405, December 2014, 314 . 316 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 317 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 318 May 2017, . 320 5.2. Informative References 322 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 323 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 324 . 326 5.3. URIs 328 [1] https://lists.w3.org/Archives/Public/ietf-http-wg/ 330 [2] https://httpwg.org/ 332 [3] https://github.com/httpwg/http-extensions/labels/cache-header 334 Author's Address 336 Mark Nottingham 337 Fastly 339 Email: mnot@mnot.net 340 URI: https://www.mnot.net/