idnits 2.17.00 (12 Aug 2021) /tmp/idnits26895/draft-ietf-httpbis-cache-header-06.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (13 January 2021) is 492 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) == Outdated reference: draft-ietf-httpbis-header-structure has been published as RFC 8941 Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). 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 13 January 2021 5 Expires: 17 July 2021 7 The Cache-Status HTTP Response Header Field 8 draft-ietf-httpbis-cache-header-06 10 Abstract 12 To aid debugging, HTTP caches often append header fields to a 13 response explaining how they handled the request. This specification 14 codifies that practice and updates it to align with HTTP's current 15 caching model. 17 Note to Readers 19 _RFC EDITOR: please remove this section before publication_ 21 Discussion of this draft takes place on the HTTP working group 22 mailing list (ietf-http-wg@w3.org), which is archived at 23 https://lists.w3.org/Archives/Public/ietf-http-wg/ 24 (https://lists.w3.org/Archives/Public/ietf-http-wg/). 26 Working Group information can be found at https://httpwg.org/ 27 (https://httpwg.org/); source code and issues list for this draft can 28 be found at https://github.com/httpwg/http-extensions/labels/cache- 29 header (https://github.com/httpwg/http-extensions/labels/cache- 30 header). 32 Status of This Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at https://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on 17 July 2021. 49 Copyright Notice 51 Copyright (c) 2021 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 56 license-info) in effect on the date of publication of this document. 57 Please review these documents carefully, as they describe your rights 58 and restrictions with respect to this document. Code Components 59 extracted from this document must include Simplified BSD License text 60 as described in Section 4.e of the Trust Legal Provisions and are 61 provided without warranty as described in the Simplified BSD License. 63 Table of Contents 65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 66 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 67 2. The Cache-Status HTTP Response Header Field . . . . . . . . . 3 68 2.1. The hit parameter . . . . . . . . . . . . . . . . . . . . 4 69 2.2. The fwd parameter . . . . . . . . . . . . . . . . . . . . 4 70 2.3. The fwd-status parameter . . . . . . . . . . . . . . . . 5 71 2.4. The ttl parameter . . . . . . . . . . . . . . . . . . . . 5 72 2.5. The stored parameter . . . . . . . . . . . . . . . . . . 5 73 2.6. The collapsed parameter . . . . . . . . . . . . . . . . . 5 74 2.7. The key parameter . . . . . . . . . . . . . . . . . . . . 5 75 2.8. The detail parameter . . . . . . . . . . . . . . . . . . 6 76 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 6 77 4. Defining New Proxy-Status Parameters . . . . . . . . . . . . 7 78 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 79 6. Security Considerations . . . . . . . . . . . . . . . . . . . 8 80 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 81 7.1. Normative References . . . . . . . . . . . . . . . . . . 8 82 7.2. Informative References . . . . . . . . . . . . . . . . . 9 83 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 9 85 1. Introduction 87 To aid debugging, HTTP caches often append header fields to a 88 response explaining how they handled the request. Unfortunately, the 89 semantics of these headers are often unclear, and both the semantics 90 and syntax used vary between implementations. 92 This specification defines a new HTTP response header field, "Cache- 93 Status" for this purpose. 95 1.1. Notational Conventions 97 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 98 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 99 "OPTIONAL" in this document are to be interpreted as described in BCP 100 14 [RFC2119] [RFC8174] when, and only when, they appear in all 101 capitals, as shown here. 103 This document uses ABNF as defined in [RFC5234], along with the "%s" 104 extension for case sensitivity defined in [RFC7405]. 106 2. The Cache-Status HTTP Response Header Field 108 The Cache-Status HTTP response header field indicates caches' 109 handling of the request corresponding to the response it occurs 110 within. 112 Its value is a List [I-D.ietf-httpbis-header-structure], Section 3.1: 114 Cache-Status = sf-list 116 Each member of the list represents a cache that has handled the 117 request. The first member of the list represents the cache closest 118 to the origin server, and the last member of the list represents the 119 cache closest to the user (possibly including the user agent's cache 120 itself, if it appends a value). 122 Caches determine when it is appropriate to add the Cache-Status 123 header field to a response. Some might add it to all responses, 124 whereas others might only do so when specifically configured to, or 125 when the request contains a header field that activates a debugging 126 mode. 128 When adding a value to the Cache-Status header field, caches SHOULD 129 preserve the existing field value, to allow debugging of the entire 130 chain of caches handling the request. 132 Each list member identifies the cache that inserted it and MUST be a 133 String or Token. Depending on the deployment, this might be a 134 product or service name (e.g., ExampleCache or "Example CDN"), a 135 hostname ("cache-3.example.com"), an IP address, or a generated 136 string. 138 Each member of the list can have parameters that describe that 139 cache's handling of the request. While these parameters are 140 OPTIONAL, caches are encouraged to provide as much information as 141 possible. 143 This specification defines the following parameters: 145 hit = sf-boolean 146 fwd = sf-token 147 fwd-status = sf-integer 148 ttl = sf-integer 149 stored = sf-boolean 150 collapsed = sf-boolean 151 key = sf-string 152 detail = sf-token / sf-string 154 2.1. The hit parameter 156 "hit", when true, indicates that the request was satisfied by the 157 cache; i.e., it was not forwarded, and the response was obtained from 158 the cache. A response that was originally produced by the origin but 159 was modified by the cache (for example, a 304 or 206 status code) is 160 still considered a hit, as long as it did not go forward (e.g., for 161 validation). 163 "hit" and "fwd" are exclusive; only one of them should appear on each 164 list member. 166 2.2. The fwd parameter 168 "fwd" indicates that the request went forward towards the origin, and 169 why. 171 The following parameter values are defined to explain why the request 172 went forward, from most specific to least: 174 * bypass - The cache was configured to not handle this request 176 * method - The request method's semantics require the request to be 177 forwarded 179 * request - The cache was able to select a fresh response for the 180 request, but the request's semantics (e.g., Cache-Control request 181 directives) did not allow its use 183 * stale - The cache was able to select a response for the request, 184 but it was stale 186 * uri-miss - The cache did not contain any responses that matched 187 the request URI 189 * vary-miss - The cache contained a response that matched the 190 request URI, but could not select a response based upon this 191 request's headers and stored Vary headers. 193 * miss - The cache did not contain any responses that could be used 194 to satisfy this request (to be used when an implementation cannot 195 distinguish between uri-miss and vary-miss) 197 The most specific reason that the cache is aware of SHOULD be used. 199 2.3. The fwd-status parameter 201 "fwd-status" indicates what status code the next hop server returned 202 in response to the request. Only meaningful when "fwd" is present; 203 if "fwd-status" is not present but "fwd" is, it defaults to the 204 status code sent in the response. 206 This parameter is useful to distinguish cases when the next hop 207 server sends a 304 Not Modified response to a conditional request, or 208 a 206 Partial Response because of a range request. 210 2.4. The ttl parameter 212 "ttl" indicates the response's remaining freshness lifetime as 213 calculated by the cache, as an integer number of seconds, measured 214 when the response header section is sent by the cache. This includes 215 freshness assigned by the cache; e.g., through heuristics, local 216 configuration, or other factors. May be negative, to indicate 217 staleness. 219 2.5. The stored parameter 221 "stored" indicates whether the cache stored the response; a true 222 value indicates that it did. Only meaningful when fwd is present. 224 2.6. The collapsed parameter 226 "collapsed" indicates whether this request was collapsed together 227 with one or more other forward requests; if true, the response was 228 successfully reused; if not, a new request had to be made. If not 229 present, the request was not collapsed with others. Only meaningful 230 when fwd is present. 232 2.7. The key parameter 234 "key" conveys a representation of the cache key used for the 235 response. Note that this may be implementation-specific. 237 2.8. The detail parameter 239 "detail" allows implementations to convey additional information not 240 captured in other parameters; for example, implementation-specific 241 states, or other caching-related metrics. 243 For example: 245 Cache-Status: ExampleCache; hit; detail=MEMORY 247 The semantics of a detail parameter are always specific to the cache 248 that sent it; even if a member of details from another cache shares 249 the same name, it might not mean the same thing. 251 This parameter is intentionally limited. If an implementation's 252 developer or operator needs to convey additional information in an 253 interoperable fashion, they are encouraged to register extension 254 parameters (see Section 4) or define another header field. 256 3. Examples 258 The most minimal cache hit: 260 Cache-Status: ExampleCache; hit 262 ... but a polite cache will give some more information, e.g.: 264 Cache-Status: ExampleCache; hit; ttl=376 266 A stale hit just has negative freshness: 268 Cache-Status: ExampleCache; hit; ttl=-412 270 Whereas a complete miss is: 272 Cache-Status: ExampleCache; fwd=uri-miss 274 A miss that successfully validated on the back-end server: 276 Cache-Status: ExampleCache; fwd=stale; fwd-status=304 278 A miss that was collapsed with another request: 280 Cache-Status: ExampleCache; fwd=uri-miss; collapsed 282 A miss that the cache attempted to collapse, but couldn't: 284 Cache-Status: ExampleCache; fwd=uri-miss; collapsed=?0 285 Going through two layers of caching, both of which were hits, and the 286 second collapsed with other requests: 288 Cache-Status: OriginCache; hit; ttl=1100; collapsed, 289 "CDN Company Here"; hit; ttl=545 291 4. Defining New Proxy-Status Parameters 293 New Cache-Status Parameters can be defined by registering them in the 294 HTTP Cache-Status Parameters registry. 296 Registration requests are reviewed and approved by a Designated 297 Expert, as per [RFC8126], Section 4.5. A specification document is 298 appreciated, but not required. 300 The Expert(s) should consider the following factors when evaluating 301 requests: 303 * Community feedback 305 * If the value is sufficiently well-defined 307 * Generic parameters are preferred over vendor-specific, 308 application-specific, or deployment-specific values. If a generic 309 value cannot be agreed upon in the community, the parameter's name 310 should be correspondingly specific (e.g., with a prefix that 311 identifies the vendor, application or deployment). 313 Registration requests should use the following template: 315 * Name: [a name for the Cache-Status Parameter that matches key] 317 * Description: [a description of the parameter semantics and value] 319 * Reference: [to a specification defining this parameter] 321 See the registry at https://iana.org/assignments/http-cache-status 322 (https://iana.org/assignments/http-cache-status) for details on where 323 to send registration requests. 325 5. IANA Considerations 327 Upon publication, please create the HTTP Cache-Status Parameters 328 registry at https://iana.org/assignments/http-cache-status 329 (https://iana.org/assignments/http-cache-status) and populate it with 330 the types defined in Section 2; see Section 4 for its associated 331 procedures. 333 6. Security Considerations 335 Attackers can use the information in Cache-Status to probe the 336 behaviour of the cache (and other components), and infer the activity 337 of those using the cache. The Cache-Status header field may not 338 create these risks on its own, but can assist attackers in exploiting 339 them. 341 For example, knowing if a cache has stored a response can help an 342 attacker execute a timing attack on sensitive data. Exposing the 343 cache key can help an attacker understand modifications to the cache 344 key, which may assist cache poisoning attacks. See [ENTANGLE] for 345 details. 347 The underlying risks can be mitigated with a variety of techniques 348 (e.g., use of encryption and authentication; avoiding the inclusion 349 of attacker-controlled data in the cache key), depending on their 350 exact nature. 352 To avoid assisting such attacks, the Cache-Status header field can be 353 omitted, only sent when the client is authorized to receive it, or 354 only send sensitive information (e.g., the key parameter) when the 355 client is authorized. 357 7. References 359 7.1. Normative References 361 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 362 Requirement Levels", BCP 14, RFC 2119, 363 DOI 10.17487/RFC2119, March 1997, 364 . 366 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 367 Writing an IANA Considerations Section in RFCs", BCP 26, 368 RFC 8126, DOI 10.17487/RFC8126, June 2017, 369 . 371 [I-D.ietf-httpbis-header-structure] 372 Nottingham, M. and P. Kamp, "Structured Field Values for 373 HTTP", Work in Progress, Internet-Draft, draft-ietf- 374 httpbis-header-structure-19, 3 June 2020, 375 . 378 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 379 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 380 May 2017, . 382 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 383 Specifications: ABNF", STD 68, RFC 5234, 384 DOI 10.17487/RFC5234, January 2008, 385 . 387 [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", 388 RFC 7405, DOI 10.17487/RFC7405, December 2014, 389 . 391 7.2. Informative References 393 [ENTANGLE] Kettle, J., "Web Cache Entanglement: Novel Pathways to 394 Poisoning", n.d., . 398 Author's Address 400 Mark Nottingham 401 Fastly 402 Prahran VIC 403 Australia 405 Email: mnot@mnot.net 406 URI: https://www.mnot.net/