draft-ietf-httpbis-cache-header-03.txt   draft-ietf-httpbis-cache-header-04.txt 
HTTP M. Nottingham HTTP M. Nottingham
Internet-Draft Fastly Internet-Draft Fastly
Intended status: Standards Track March 1, 2020 Intended status: Standards Track August 5, 2020
Expires: September 2, 2020 Expires: February 6, 2021
The Cache-Status HTTP Response Header Field The Cache-Status HTTP Response Header Field
draft-ietf-httpbis-cache-header-03 draft-ietf-httpbis-cache-header-04
Abstract Abstract
To aid debugging, HTTP caches often append headers to a response To aid debugging, HTTP caches often append header fields to a
detailing how they handled the request. This specification codifies response explaining how they handled the request. This specification
that practice and updates it for HTTP's current caching model. codifies that practice and updates it to align with HTTP's current
caching model.
Note to Readers Note to Readers
_RFC EDITOR: please remove this section before publication_ _RFC EDITOR: please remove this section before publication_
Discussion of this draft takes place on the HTTP working group Discussion of this draft takes place on the HTTP working group
mailing list (ietf-http-wg@w3.org), which is archived at mailing list (ietf-http-wg@w3.org), which is archived at
https://lists.w3.org/Archives/Public/ietf-http-wg/ [1]. https://lists.w3.org/Archives/Public/ietf-http-wg/ [1].
Working Group information can be found at https://httpwg.org/ [2]; Working Group information can be found at https://httpwg.org/ [2];
skipping to change at page 1, line 44 skipping to change at page 1, line 45
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 2, 2020. This Internet-Draft will expire on February 6, 2021.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 32 skipping to change at page 2, line 32
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3
2. The Cache-Status HTTP Response Header Field . . . . . . . . . 3 2. The Cache-Status HTTP Response Header Field . . . . . . . . . 3
2.1. The hit parameter . . . . . . . . . . . . . . . . . . . . 4 2.1. The hit parameter . . . . . . . . . . . . . . . . . . . . 4
2.2. The fwd parameter . . . . . . . . . . . . . . . . . . . . 4 2.2. The fwd parameter . . . . . . . . . . . . . . . . . . . . 4
2.3. The fwd-status parameter . . . . . . . . . . . . . . . . 5 2.3. The fwd-status parameter . . . . . . . . . . . . . . . . 5
2.4. The ttl parameter . . . . . . . . . . . . . . . . . . . . 5 2.4. The ttl parameter . . . . . . . . . . . . . . . . . . . . 5
2.5. The stored parameter . . . . . . . . . . . . . . . . . . 5 2.5. The stored parameter . . . . . . . . . . . . . . . . . . 5
2.6. The collapsed parameter . . . . . . . . . . . . . . . . . 5 2.6. The collapsed parameter . . . . . . . . . . . . . . . . . 5
2.7. The key parameter . . . . . . . . . . . . . . . . . . . . 5 2.7. The key parameter . . . . . . . . . . . . . . . . . . . . 5
3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.8. The detail parameter . . . . . . . . . . . . . . . . . . 5
4. Security Considerations . . . . . . . . . . . . . . . . . . . 6 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 6
5. References . . . . . . . . . . . . . . . . . . . . . . . . . 7 4. Defining New Proxy-Status Parameters . . . . . . . . . . . . 7
5.1. Normative References . . . . . . . . . . . . . . . . . . 7 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7
5.2. Informative References . . . . . . . . . . . . . . . . . 7 6. Security Considerations . . . . . . . . . . . . . . . . . . . 7
5.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 8
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 7.1. Normative References . . . . . . . . . . . . . . . . . . 8
7.2. Informative References . . . . . . . . . . . . . . . . . 9
7.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 9
1. Introduction 1. Introduction
To aid debugging, HTTP caches often append headers to a response To aid debugging, HTTP caches often append header fields to a
detailing how they handled the request. response explaining how they handled the request. Unfortunately, the
semantics of these headers are often unclear, and both the semantics
Unfortunately, the semantics of these headers are often unclear, and and syntax used vary greatly between implementations.
both the semantics and syntax used vary greatly between
implementations.
This specification defines a single, new HTTP response header field, This specification defines a single, new HTTP response header field,
"Cache-Status" for this purpose. "Cache-Status" for this purpose.
1.1. Notational Conventions 1.1. Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
skipping to change at page 3, line 23 skipping to change at page 3, line 23
This document uses ABNF as defined in [RFC5234], along with the "%s" This document uses ABNF as defined in [RFC5234], along with the "%s"
extension for case sensitivity defined in [RFC7405]. extension for case sensitivity defined in [RFC7405].
2. The Cache-Status HTTP Response Header Field 2. The Cache-Status HTTP Response Header Field
The Cache-Status HTTP response header indicates caches' handling of The Cache-Status HTTP response header indicates caches' handling of
the request corresponding to the response it occurs within. the request corresponding to the response it occurs within.
Its value is a List [I-D.ietf-httpbis-header-structure]: Its value is a List [I-D.ietf-httpbis-header-structure]:
Cache-Status = sh-list Cache-Status = sf-list
Each member of the list represents a cache that has handled the Each member of the list represents a cache that has handled the
request. The first member of the list represents the cache closest request. The first member of the list represents the cache closest
to the origin server, and the last member of the list represents the to the origin server, and the last member of the list represents the
cache closest to the client (possibly including the user agent's cache closest to the client (possibly including the user agent's
cache itself, if it chooses to append a value). cache itself, if it chooses to append a value).
Caches determine when it is appropriate to add the Cache-Status Caches determine when it is appropriate to add the Cache-Status
header field to a response. Some might decide to add it to all header field to a response. Some might decide to add it to all
responses, whereas others might only do so when specifically responses, whereas others might only do so when specifically
configured to, or when the request contains a header that activates a configured to, or when the request contains a header that activates a
debugging mode. debugging mode.
When adding a value to the Cache-Status header field, caches SHOULD When adding a value to the Cache-Status header field, caches SHOULD
preserve the existing contents of the header, to allow debugging of preserve the existing contents of the header field, to allow
the entire chain of caches handling the request. debugging of the entire chain of caches handling the request.
Each list member identifies the cache that inserted that value, and Each list member identifies the cache that inserted that value, and
MUST have a type of either sh-string or sh-token. Depending on the MUST be a String or Token. Depending on the deployment, this might
deployment, this might be a product or service name (e.g., be a product or service name (e.g., ExampleCache or "Example CDN"), a
ExampleCache or "Example CDN"), a hostname ("cache-3.example.com"), hostname ("cache-3.example.com"), and IP address, or a generated
and IP address, or a generated string. string.
Each member of the list can also have parameters that describe that Each member of the list can also have parameters that describe that
cache's handling of the request. While all of these parameters are cache's handling of the request. While all of these parameters are
OPTIONAL, caches are encouraged to provide as much information as OPTIONAL, caches are encouraged to provide as much information as
possible. possible.
This specification defines these parameters: This specification defines these parameters:
hit = sh-boolean hit = sf-boolean
fwd = sh-token fwd = sf-token
fwd-status = sh-integer fwd-status = sf-integer
ttl = sh-integer ttl = sf-integer
stored = sh-boolean stored = sf-boolean
collapsed = sh-boolean collapsed = sf-boolean
key = sh-string key = sf-string
detail = sf-token / sf-string
2.1. The hit parameter 2.1. The hit parameter
"hit", when true, indicates that the request was satisfied by the "hit", when true, indicates that the request was satisfied by the
cache; i.e., it did not go forward, and the response was obtained cache; i.e., it did not go forward and the response was obtained from
from the cache (possibly with modifications; e.g., if the request was the cache. A response that originally was produced by the origin but
conditional, a 304 Not Modified could be generated from cache). was modified by the cache (for example, a 304 or 206 status code) is
still considered a hit.
"hit" and "fwd" are exclusive; only one of them should appear on each "hit" and "fwd" are exclusive; only one of them should appear on each
list member. list member.
2.2. The fwd parameter 2.2. The fwd parameter
"fwd" indicates why the request went forward. "fwd" indicates that the request went forward towards the origin, and
why.
It can have one of the following values: The following values are defined to explain why the request went
forward:
o uri-miss - The cache did not contain any responses that matched o uri-miss - The cache did not contain any responses that matched
the request URI the request URI
o vary-miss - The cache contained a response that matched the o vary-miss - The cache contained a response that matched the
request URI, but could not select a response based upon this request URI, but could not select a response based upon this
request's headers and stored Vary headers. request's headers and stored Vary headers.
o miss - The cache did not contain any responses that could be used o miss - The cache did not contain any responses that could be used
to satisfy this request (to be used when an implementation cannot to satisfy this request (to be used when an implementation cannot
skipping to change at page 5, line 26 skipping to change at page 5, line 26
2.4. The ttl parameter 2.4. The ttl parameter
"ttl" indicates the response's remaining freshness lifetime as "ttl" indicates the response's remaining freshness lifetime as
calculated by the cache, as an integer number of seconds, measured calculated by the cache, as an integer number of seconds, measured
when the response is sent by the cache. This includes freshness when the response is sent by the cache. This includes freshness
assigned by the cache; e.g., through heuristics, local configuration, assigned by the cache; e.g., through heuristics, local configuration,
or other factors. May be negative, to indicate staleness. or other factors. May be negative, to indicate staleness.
2.5. The stored parameter 2.5. The stored parameter
"stored" indicates whether the cache stored the forward response; a "stored" indicates whether the cache stored the response; a true
true value indicates that it did. Only meaningful when fwd is value indicates that it did. Only meaningful when fwd is present.
present.
2.6. The collapsed parameter 2.6. The collapsed parameter
"collapsed" indicates whether this request was collapsed together "collapsed" indicates whether this request was collapsed together
with one or more other forward requests; if true, the response was with one or more other forward requests; if true, the response was
successfully reused; if not, a new request had to be made. If not successfully reused; if not, a new request had to be made. If not
present, the request was not collapsed with others. Only meaningful present, the request was not collapsed with others. Only meaningful
when fwd is present. when fwd is present.
2.7. The key parameter 2.7. The key parameter
"key" conveys a representation of the cache key used for the "key" conveys a representation of the cache key used for the
response. Note that this may be implementation-specific. response. Note that this may be implementation-specific.
2.8. The detail parameter
"detail" allows implementations to convey additional information not
captured in other parameters; for example, implementation-specific
states, or other caching-related metrics.
For example:
Cache-Status: ExampleCache; hit; detail=MEMORY
The semantics of a detail parameter are always specific to the cache
that sent it; even if a member of details from another cache shares
the same name, it might not mean the same thing.
This parameter is intentionally limited. If an implementation needs
to convey additional information, they are encouraged to register
extension parameters (see Section 4) or define another header field.
3. Examples 3. Examples
The most minimal cache hit: The most minimal cache hit:
Cache-Status: ExampleCache; hit Cache-Status: ExampleCache; hit
... but a polite cache will give some more information, e.g.: ... but a polite cache will give some more information, e.g.:
Cache-Status: ExampleCache; hit; ttl=376 Cache-Status: ExampleCache; hit; ttl=376
A stale hit just has negative freshness: A stale hit just has negative freshness:
Cache-Status: ExampleCache; hit; ttl=-412 Cache-Status: ExampleCache; hit; ttl=-412
Whereas a complete miss is: Whereas a complete miss is:
Cache-Status: ExampleCache; fwd=uri-miss Cache-Status: ExampleCache; fwd=uri-miss
A miss that successfully validated on the back-end server: A miss that successfully validated on the back-end server:
skipping to change at page 6, line 30 skipping to change at page 7, line 5
A miss that the cache attempted to collapse, but couldn't: A miss that the cache attempted to collapse, but couldn't:
Cache-Status: ExampleCache; fwd=uri-miss; collapsed=?0 Cache-Status: ExampleCache; fwd=uri-miss; collapsed=?0
Going through two layers of caching, both of which were hits, and the Going through two layers of caching, both of which were hits, and the
second collapsed with other requests: second collapsed with other requests:
Cache-Status: OriginCache; hit; ttl=1100; collapsed, Cache-Status: OriginCache; hit; ttl=1100; collapsed,
"CDN Company Here"; hit; ttl=545 "CDN Company Here"; hit; ttl=545
4. Security Considerations 4. Defining New Proxy-Status Parameters
New Cache-Status Parameters can be defined by registering them in the
HTTP Cache-Status Parameters registry.
Registration requests are reviewed and approved by a Designated
Expert, as per [RFC8126], Section 4.5. A specification document is
appreciated, but not required.
The Expert(s) should consider the following factors when evaluating
requests:
o Community feedback
o If the value is sufficiently well-defined
o Generic parameters are preferred over vendor-specific,
application-specific or deployment-specific values. If a generic
value cannot be agreed upon in the community, the parameter's name
should be correspondingly specific (e.g., with a prefix that
identifies the vendor, application or deployment).
Registration requests should use the following template:
o Name: [a name for the Cache-Status Parameter that matches key]
o Description: [a description of the parameter semantics and value]
o Reference: [to a specification defining this parameter]
See the registry at https://iana.org/assignments/http-cache-status
[4] for details on where to send registration requests.
5. IANA Considerations
Upon publication, please create the HTTP Cache-Status Parameters
registry at https://iana.org/assignments/http-cache-statuses [5] and
populate it with the types defined in Section 2; see Section 4 for
its associated procedures.
6. Security Considerations
Information about a cache's content can be used to infer the activity Information about a cache's content can be used to infer the activity
of those using it. Generally, access to sensitive information in a of those using it. Generally, access to sensitive information in a
cache is limited to those who are authorised to access that cache is limited to those who are authorised to access that
information (using a variety of techniques), so this does not information (using a variety of techniques), so this does not
represent an attack vector in the general sense. represent an attack vector in the general sense.
However, if the Cache-Status header is exposed to parties who are not However, if the Cache-Status header field is exposed to parties who
authorised to obtain the response it occurs within, it could expose are not authorised to obtain the response it occurs within, it could
information about that data. expose information about that data.
For example, if an attacker were able to obtain the Cache-Status For example, if an attacker were able to obtain the Cache-Status
header from a response containing sensitive information and access header field from a response containing sensitive information and
were limited to one person (or limited set of people), they could access were limited to one person (or limited set of people), they
determine whether that information had been accessed before. This is could determine whether that information had been accessed before.
similar to the information exposed by various timing attacks, but is This is similar to the information exposed by various timing attacks,
arguably more reliable, since the cache is directly reporting its but is arguably more reliable, since the cache is directly reporting
state. its state.
Mitigations include use of encryption (e.g., TLS [RFC8446])) to Mitigations include use of encryption (e.g., TLS [RFC8446])) to
protect the response, and careful controls over access to response protect the response, and careful controls over access to response
headers (as are present in the Web platform). When in doubt, the header fields (as are present in the Web platform). When in doubt,
Cache-Status header field can be omitted. the Cache-Status header field can be omitted.
5. References 7. References
5.1. Normative References 7.1. Normative References
[I-D.ietf-httpbis-header-structure] [I-D.ietf-httpbis-header-structure]
Nottingham, M. and P. Kamp, "Structured Headers for HTTP", Nottingham, M. and P. Kamp, "Structured Field Values for
draft-ietf-httpbis-header-structure-13 (work in progress), HTTP", draft-ietf-httpbis-header-structure-19 (work in
August 2019. progress), June 2020.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", STD 68, RFC 5234, Specifications: ABNF", STD 68, RFC 5234,
DOI 10.17487/RFC5234, January 2008, DOI 10.17487/RFC5234, January 2008,
<https://www.rfc-editor.org/info/rfc5234>. <https://www.rfc-editor.org/info/rfc5234>.
[RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF",
RFC 7405, DOI 10.17487/RFC7405, December 2014, RFC 7405, DOI 10.17487/RFC7405, December 2014,
<https://www.rfc-editor.org/info/rfc7405>. <https://www.rfc-editor.org/info/rfc7405>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/info/rfc8126>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
5.2. Informative References 7.2. Informative References
[RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
<https://www.rfc-editor.org/info/rfc8446>. <https://www.rfc-editor.org/info/rfc8446>.
5.3. URIs 7.3. URIs
[1] https://lists.w3.org/Archives/Public/ietf-http-wg/ [1] https://lists.w3.org/Archives/Public/ietf-http-wg/
[2] https://httpwg.org/ [2] https://httpwg.org/
[3] https://github.com/httpwg/http-extensions/labels/cache-header [3] https://github.com/httpwg/http-extensions/labels/cache-header
[4] https://iana.org/assignments/http-cache-status
[5] https://iana.org/assignments/http-cache-statuses
Author's Address Author's Address
Mark Nottingham Mark Nottingham
Fastly Fastly
made in
Prahran, VIC
Australia
Email: mnot@mnot.net Email: mnot@mnot.net
URI: https://www.mnot.net/ URI: https://www.mnot.net/
 End of changes. 28 change blocks. 
61 lines changed or deleted 136 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/