draft-ietf-httpbis-cache-digest-04.txt   draft-ietf-httpbis-cache-digest-05.txt 
HTTP Working Group K. Oku HTTP Working Group K. Oku
Internet-Draft Fastly Internet-Draft Fastly
Intended status: Experimental Y. Weiss Intended status: Experimental Y. Weiss
Expires: October 8, 2018 Akamai Expires: January 3, 2019 Akamai
April 6, 2018 July 2, 2018
Cache Digests for HTTP/2 Cache Digests for HTTP/2
draft-ietf-httpbis-cache-digest-04 draft-ietf-httpbis-cache-digest-05
Abstract Abstract
This specification defines a HTTP/2 frame type to allow clients to This specification defines a HTTP/2 frame type to allow clients to
inform the server of their cache's contents. Servers can then use inform the server of their cache's contents. Servers can then use
this to inform their choices of what to push to clients. this to inform their choices of what to push to clients.
Note to Readers Note to Readers
Discussion of this draft takes place on the HTTP working group Discussion of this draft takes place on the HTTP working group
skipping to change at page 1, line 43 skipping to change at page 1, line 43
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 http://datatracker.ietf.org/drafts/current/. Drafts is at http://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 October 8, 2018. This Internet-Draft will expire on January 3, 2019.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2018 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
(http://trustee.ietf.org/license-info) in effect on the date of (http://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 21 skipping to change at page 2, line 21
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3
2. The CACHE_DIGEST Frame . . . . . . . . . . . . . . . . . . . 3 2. The CACHE_DIGEST Frame . . . . . . . . . . . . . . . . . . . 3
2.1. Client Behavior . . . . . . . . . . . . . . . . . . . . . 4 2.1. Client Behavior . . . . . . . . . . . . . . . . . . . . . 4
2.1.1. Creating a digest . . . . . . . . . . . . . . . . . . 5 2.1.1. Creating a digest . . . . . . . . . . . . . . . . . . 4
2.1.2. Adding a URL to the Digest-Value . . . . . . . . . . 6 2.1.2. Adding a URL to the Digest-Value . . . . . . . . . . 5
2.1.3. Removing a URL to the Digest-Value . . . . . . . . . 7 2.1.3. Removing a URL to the Digest-Value . . . . . . . . . 7
2.1.4. Computing a fingerprint value . . . . . . . . . . . . 8 2.1.4. Computing a fingerprint value . . . . . . . . . . . . 8
2.1.5. Computing the key . . . . . . . . . . . . . . . . . . 9 2.1.5. Computing the key . . . . . . . . . . . . . . . . . . 9
2.1.6. Computing a Hash Value . . . . . . . . . . . . . . . 10 2.1.6. Computing a Hash Value . . . . . . . . . . . . . . . 9
2.1.7. Computing an Alternative Hash Value . . . . . . . . . 10 2.1.7. Computing an Alternative Hash Value . . . . . . . . . 9
2.2. Server Behavior . . . . . . . . . . . . . . . . . . . . . 10 2.2. Server Behavior . . . . . . . . . . . . . . . . . . . . . 10
2.2.1. Querying the Digest for a Value . . . . . . . . . . . 11 2.2.1. Querying the Digest for a Value . . . . . . . . . . . 10
3. The SENDING_CACHE_DIGEST SETTINGS Parameter . . . . . . . . . 12 3. The SETTINGS_SENDING_CACHE_DIGEST SETTINGS Parameter . . . . 11
4. The ACCEPT_CACHE_DIGEST SETTINGS Parameter . . . . . . . . . 12 4. The SETTINGS_ACCEPT_CACHE_DIGEST SETTINGS Parameter . . . . . 12
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 12
6. Security Considerations . . . . . . . . . . . . . . . . . . . 14 6. Security Considerations . . . . . . . . . . . . . . . . . . . 13
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 14 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 13
7.1. Normative References . . . . . . . . . . . . . . . . . . 14 7.1. Normative References . . . . . . . . . . . . . . . . . . 13
7.2. Informative References . . . . . . . . . . . . . . . . . 15 7.2. Informative References . . . . . . . . . . . . . . . . . 14
Appendix A. Encoding the CACHE_DIGEST frame as an HTTP Header . 16 Appendix A. Encoding the CACHE_DIGEST frame as an HTTP Header . 15
Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 17 Appendix B. Changes . . . . . . . . . . . . . . . . . . . . . . 16
Appendix C. Changes . . . . . . . . . . . . . . . . . . . . . . 17 B.1. Since draft-ietf-httpbis-cache-digest-04 . . . . . . . . 16
C.1. Since draft-ietf-httpbis-cache-digest-03 . . . . . . . . 17 B.2. Since draft-ietf-httpbis-cache-digest-03 . . . . . . . . 16
C.2. Since draft-ietf-httpbis-cache-digest-02 . . . . . . . . 17 B.3. Since draft-ietf-httpbis-cache-digest-02 . . . . . . . . 16
C.3. Since draft-ietf-httpbis-cache-digest-01 . . . . . . . . 17 B.4. Since draft-ietf-httpbis-cache-digest-01 . . . . . . . . 16
C.4. Since draft-ietf-httpbis-cache-digest-00 . . . . . . . . 18 B.5. Since draft-ietf-httpbis-cache-digest-00 . . . . . . . . 17
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 18 Appendix C. Acknowledgements . . . . . . . . . . . . . . . . . . 17
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 17
1. Introduction 1. Introduction
HTTP/2 [RFC7540] allows a server to "push" synthetic request/response HTTP/2 [RFC7540] allows a server to "push" synthetic request/response
pairs into a client's cache optimistically. While there is strong pairs into a client's cache optimistically. While there is strong
interest in using this facility to improve perceived Web browsing interest in using this facility to improve perceived Web browsing
performance, it is sometimes counterproductive because the client performance, it is sometimes counterproductive because the client
might already have cached the "pushed" response. might already have cached the "pushed" response.
When this is the case, the bandwidth used to "push" the response is When this is the case, the bandwidth used to "push" the response is
effectively wasted, and represents opportunity cost, because it could effectively wasted, and represents opportunity cost, because it could
be used by other, more relevant responses. HTTP/2 allows a stream to be used by other, more relevant responses. HTTP/2 allows a stream to
be cancelled by a client using a RST_STREAM frame in this situation, be cancelled by a client using a RST_STREAM frame in this situation,
but there is still at least one round trip of potentially wasted but there is still at least one round trip of potentially wasted
capacity even then. capacity even then.
This specification defines a HTTP/2 frame type to allow clients to This specification defines a HTTP/2 frame type to allow clients to
inform the server of their cache's contents using a Cuckoo-filter inform the server of their freshly cached contents using a Cuckoo-
[Cuckoo] based digest. Servers can then use this to inform their filter [Cuckoo] based digest. Servers can then use this to inform
choices of what to push to clients. their choices of what to push to clients.
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", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in [RFC2119]. document are to be interpreted as described in [RFC2119].
2. The CACHE_DIGEST Frame 2. The CACHE_DIGEST Frame
The CACHE_DIGEST frame type is 0xd (decimal 13). The CACHE_DIGEST frame type is 0xd (decimal 13).
skipping to change at page 4, line 4 skipping to change at page 4, line 7
in Section 2.1.1 and Section 2.1.2. in Section 2.1.1 and Section 2.1.2.
The CACHE_DIGEST frame defines the following flags: The CACHE_DIGEST frame defines the following flags:
o *RESET* (0x1): When set, indicates that any and all cache digests o *RESET* (0x1): When set, indicates that any and all cache digests
for the applicable origin held by the recipient MUST be considered for the applicable origin held by the recipient MUST be considered
invalid. invalid.
o *COMPLETE* (0x2): When set, indicates that the currently valid set o *COMPLETE* (0x2): When set, indicates that the currently valid set
of cache digests held by the server constitutes a complete of cache digests held by the server constitutes a complete
representation of the cache's state regarding that origin, for the representation of the cache's state regarding that origin.
type of cached response indicated by the "STALE" flag.
o *VALIDATORS* (0x4): When set, indicates that the "validators"
boolean in Section 2.1.5 is true.
o *STALE* (0x8): When set, indicates that all cached responses
represented in the digest-value are stale [RFC7234] at the point
in them that the digest was generated; otherwise, all are fresh.
2.1. Client Behavior 2.1. Client Behavior
A CACHE_DIGEST frame MUST be sent from a client to a server on stream A CACHE_DIGEST frame MUST be sent from a client to a server on stream
0, and conveys a digest of the contents of the client's cache for the 0, and conveys a digest of the contents of the client's cache for the
indicated origin. indicated origin.
In typical use, a client will send one or more CACHE_DIGESTs In typical use, a client will send one or more CACHE_DIGESTs
immediately after the first request on a connection for a given immediately after the first request on a connection for a given
origin, on the same stream, because there is usually a short period origin, on the same stream, because there is usually a short period
of inactivity then, and servers can benefit most when they understand of inactivity then, and servers can benefit most when they understand
the state of the cache before they begin pushing associated assets the state of the cache before they begin pushing associated assets
(e.g., CSS, JavaScript and images). Clients MAY send CACHE_DIGEST at (e.g., CSS, JavaScript and images). Clients MAY send CACHE_DIGEST at
other times. other times.
If the cache's state is cleared, lost, or the client otherwise wishes If the cache's state is cleared, lost, or the client otherwise wishes
the server to stop using previously sent CACHE_DIGESTs, it can send a the server to stop using previously sent CACHE_DIGESTs, it can send a
CACHE_DIGEST with the RESET flag set. CACHE_DIGEST with the RESET flag set.
When generating CACHE_DIGEST, a client MUST NOT include cached When generating CACHE_DIGEST, a client MUST NOT include stale-cached
responses whose URLs do not share origins [RFC6454] with the responses or responses whose URLs do not share origins [RFC6454] with
indicated origin. Clients MUST NOT send CACHE_DIGEST frames on the indicated origin. Clients MUST NOT send CACHE_DIGEST frames on
connections that are not authoritative (as defined in [RFC7540], connections that are not authoritative (as defined in [RFC7540],
10.1) for the indicated origin. 10.1) for the indicated origin.
CACHE_DIGEST allows the client to indicate whether the set of URLs When the CACHE_DIGEST frames sent represent the complete set of
used to compute the digest represent fresh or stale stored responses, stored responses, the last such frame SHOULD have a COMPLETE flag
using the STALE flag. Clients MAY decide whether to only send set, to indicate to the server that it has all relevant state. Note
CACHE_DIGEST frames representing their fresh stored responses, their that for the purposes of COMPLETE, responses cached since the
stale stored responses, or both. beginning of the connection or the last RESET flag on a CACHE_DIGEST
frame need not be included.
Clients can choose to only send a subset of the suitable stored
responses of each type (fresh or stale). However, when the
CACHE_DIGEST frames sent represent the complete set of stored
responses of a given type, the last such frame SHOULD have a COMPLETE
flag set, to indicate to the server that it has all relevant state of
that type. Note that for the purposes of COMPLETE, responses cached
since the beginning of the connection or the last RESET flag on a
CACHE_DIGEST frame need not be included.
CACHE_DIGEST can be computed to include cached responses' ETags, as
indicated by the VALIDATORS flag. This information can be used by
servers to decide what kinds of responses to push to clients; for
example, a stale response that hasn't changed could be refreshed with
a 304 (Not Modified) response; one that has changed can be replaced
with a 200 (OK) response, whether the cached response was fresh or
stale.
CACHE_DIGEST has no defined meaning when sent from servers, and CACHE_DIGEST has no defined meaning when sent from servers, and
SHOULD be ignored by clients. SHOULD be ignored by clients.
2.1.1. Creating a digest 2.1.1. Creating a digest
Given the following inputs: Given the following inputs:
o "P", an integer smaller than 256, that indicates the probability o "P", an integer smaller than 256, that indicates the probability
of a false positive that is acceptable, expressed as "1/2\*\*P". of a false positive that is acceptable, expressed as "1/2\*\*P".
skipping to change at page 6, line 15 skipping to change at page 5, line 43
recommended that implementations pick a number of entries that's recommended that implementations pick a number of entries that's
close to the next power of 2. close to the next power of 2.
2.1.2. Adding a URL to the Digest-Value 2.1.2. Adding a URL to the Digest-Value
Given the following inputs: Given the following inputs:
o "URL" a string corresponding to the Effective Request URI o "URL" a string corresponding to the Effective Request URI
([RFC7230], Section 5.5) of a cached response [RFC7234] ([RFC7230], Section 5.5) of a cached response [RFC7234]
o "ETag" a string corresponding to the entity-tag [RFC7232] of a
cached response [RFC7234] (if the ETag is available; otherwise,
null);
o "maxcount" - max number of cuckoo hops o "maxcount" - max number of cuckoo hops
o "digest-value" o "digest-value"
1. Let "f" be the value of the first byte of "digest-value". 1. Let "f" be the value of the first byte of "digest-value".
2. Let "b" be the bucket size, defined as 4. 2. Let "b" be the bucket size, defined as 4.
3. Let "N" be the value of the second to fifth bytes of "digest- 3. Let "N" be the value of the second to fifth bytes of "digest-
value" in big endian form. value" in big endian form.
4. Let "key" be the return value of Section 2.1.5 with "URL" and 4. Let "key" be the return value of Section 2.1.5 with "URL" as
"ETag" as inputs. input.
5. Let "h1" be the return value of Section 2.1.6 with "key" and "N" 5. Let "h1" be the return value of Section 2.1.6 with "key" and "N"
as inputs. as inputs.
6. Let "dest_fingerprint" be the return value of Section 2.1.4 with 6. Let "dest_fingerprint" be the return value of Section 2.1.4 with
"key" and "f" as inputs. "key" and "f" as inputs.
7. Let "h2" be the return value of Section 2.1.7 with "h1", 7. Let "h2" be the return value of Section 2.1.7 with "h1",
"dest_fingerprint" and "N" as inputs. "dest_fingerprint" and "N" as inputs.
skipping to change at page 7, line 50 skipping to change at page 7, line 24
15. Go to step 7. 15. Go to step 7.
2.1.3. Removing a URL to the Digest-Value 2.1.3. Removing a URL to the Digest-Value
Given the following inputs: Given the following inputs:
o "URL" a string corresponding to the Effective Request URI o "URL" a string corresponding to the Effective Request URI
([RFC7230], Section 5.5) of a cached response [RFC7234] ([RFC7230], Section 5.5) of a cached response [RFC7234]
o "ETag" a string corresponding to the entity-tag [RFC7232] of a
cached response [RFC7234] (if the ETag is available; otherwise,
null);
o "digest-value" o "digest-value"
1. Let "f" be the value of the first byte of "digest-value". 1. Let "f" be the value of the first byte of "digest-value".
2. Let "b" be the bucket size, defined as 4. 2. Let "b" be the bucket size, defined as 4.
3. Let "N" be the value of the second to fifth bytes of "digest- 3. Let "N" be the value of the second to fifth bytes of "digest-
value" in big endian form. value" in big endian form.
4. Let "key" be the return value of Section 2.1.5 with "URL" and 4. Let "key" be the return value of Section 2.1.5 with "URL" as
"ETag" as inputs. input.
5. Let "h1" be the return value of Section 2.1.6 with "key" and "N" 5. Let "h1" be the return value of Section 2.1.6 with "key" and "N"
as inputs. as inputs.
6. Let "fingerprint" be the return value of Section 2.1.4 with "key" 6. Let "fingerprint" be the return value of Section 2.1.4 with "key"
and "f" as inputs. and "f" as inputs.
7. Let "h2" be the return value of Section 2.1.7 with "h1", 7. Let "h2" be the return value of Section 2.1.7 with "h1",
"fingerprint" and "N" as inputs. "fingerprint" and "N" as inputs.
skipping to change at page 9, line 37 skipping to change at page 9, line 11
there's an infitisimaly larger probability of getting a "fingerprint- there's an infitisimaly larger probability of getting a "fingerprint-
value" of 1 compared to all other values. This is not a problem for value" of 1 compared to all other values. This is not a problem for
any practical purpose. any practical purpose.
2.1.5. Computing the key 2.1.5. Computing the key
Given the following inputs: Given the following inputs:
o "URL", an array of characters o "URL", an array of characters
o "ETag", an array of characters
o "validators", a boolean indicating whether validators ([RFC7232])
are to be included in the digest
1. Let "key" be "URL" converted to an ASCII string by percent- 1. Let "key" be "URL" converted to an ASCII string by percent-
encoding as appropriate [RFC3986]. encoding as appropriate [RFC3986].
2. If "validators" is true and "ETag" is not null: 2. Return "key"
1. Append "ETag" to "key" as an ASCII string, including both the
"weak" indicator (if present) and double quotes, as per
[RFC7232], Section 2.3.
3. Return "key"
TODO: Add an example of the ETag and the key calcuations.
2.1.6. Computing a Hash Value 2.1.6. Computing a Hash Value
Given the following inputs: Given the following inputs:
o "key", an array of characters. o "key", an array of characters.
o "N", an integer o "N", an integer
"hash-value" can be computed using the following algorithm: "hash-value" can be computed using the following algorithm:
skipping to change at page 10, line 45 skipping to change at page 10, line 11
"fingerprint-string" and "N" as inputs, XORed with "hash1". "fingerprint-string" and "N" as inputs, XORed with "hash1".
3. Return "hash2". 3. Return "hash2".
2.2. Server Behavior 2.2. Server Behavior
In typical use, a server will query (as per Section 2.2.1) the In typical use, a server will query (as per Section 2.2.1) the
CACHE_DIGESTs received on a given connection to inform what it pushes CACHE_DIGESTs received on a given connection to inform what it pushes
to that client; to that client;
o If a given URL and ETag combination has a match in a current o If a given URL has a match in a current CACHE_DIGEST, a complete
CACHE_DIGEST, a complete response need not be pushed; The server response need not be pushed; The server MAY push a 304 response
MAY push a 304 response for that resource, indicating the client for that resource, indicating the client that it hasn't changed.
that it hasn't changed.
o If a given URL and ETag has no match in any current CACHE_DIGEST, o If a given URL has no match in any current CACHE_DIGEST, the
the client does not have a cached copy, and a complete response client does not have a cached copy, and a complete response can be
can be pushed. pushed.
Servers MAY use all CACHE_DIGESTs received for a given origin as Servers MAY use all CACHE_DIGESTs received for a given origin as
current, as long as they do not have the RESET flag set; a current, as long as they do not have the RESET flag set; a
CACHE_DIGEST frame with the RESET flag set MUST clear any previously CACHE_DIGEST frame with the RESET flag set MUST clear any previously
stored CACHE_DIGESTs for its origin. Servers MUST treat an empty stored CACHE_DIGESTs for its origin. Servers MUST treat an empty
Digest-Value with a RESET flag set as effectively clearing all stored Digest-Value with a RESET flag set as effectively clearing all stored
digests for that origin. digests for that origin.
Clients are not likely to send updates to CACHE_DIGEST over the Clients are not likely to send updates to CACHE_DIGEST over the
lifetime of a connection; it is expected that servers will separately lifetime of a connection; it is expected that servers will separately
skipping to change at page 11, line 32 skipping to change at page 10, line 42
Servers MUST ignore CACHE_DIGEST frames sent on a stream other than Servers MUST ignore CACHE_DIGEST frames sent on a stream other than
0. 0.
2.2.1. Querying the Digest for a Value 2.2.1. Querying the Digest for a Value
Given the following inputs: Given the following inputs:
o "URL" a string corresponding to the Effective Request URI o "URL" a string corresponding to the Effective Request URI
([RFC7230], Section 5.5) of a cached response [RFC7234]. ([RFC7230], Section 5.5) of a cached response [RFC7234].
o "ETag" a string corresponding to the entity-tag [RFC7232] of a
cached response [RFC7234] (if the ETag is available; otherwise,
null).
o "validators", a boolean
o "digest-value", an array of bits. o "digest-value", an array of bits.
1. Let "f" be the value of the first byte of "digest-value". 1. Let "f" be the value of the first byte of "digest-value".
2. Let "b" be the bucket size, defined as 4. 2. Let "b" be the bucket size, defined as 4.
3. Let "N" be the value of the second to fifth bytes of "digest- 3. Let "N" be the value of the second to fifth bytes of "digest-
value" in big endian form. value" in big endian form.
4. Let "key" be the return value of Section 2.1.5 with "URL" and 4. Let "key" be the return value of Section 2.1.5 with "URL" as
"ETag" as inputs. input.
5. Let "h1" be the return value of Section 2.1.6 with "key" and "N" 5. Let "h1" be the return value of Section 2.1.6 with "key" and "N"
as inputs. as inputs.
6. Let "fingerprint" be the return value of Section 2.1.4 with 6. Let "fingerprint" be the return value of Section 2.1.4 with
"key" and "f" as inputs. "key" and "f" as inputs.
7. Let "h2" be the return value of Section 2.1.7 with "h1", 7. Let "h2" be the return value of Section 2.1.7 with "h1",
"fingerprint" and "N" as inputs. "fingerprint" and "N" as inputs.
skipping to change at page 12, line 30 skipping to change at page 11, line 33
1. Let "bits" be "f" bits from "digest_value" starting at 1. Let "bits" be "f" bits from "digest_value" starting at
"position_start". "position_start".
2. If "bits" is "fingerprint", return true 2. If "bits" is "fingerprint", return true
3. Add "f" to "position_start". 3. Add "f" to "position_start".
10. Return false. 10. Return false.
3. The SENDING_CACHE_DIGEST SETTINGS Parameter 3. The SETTINGS_SENDING_CACHE_DIGEST SETTINGS Parameter
A Client SHOULD notify its support for CACHE_DIGEST frames by sending A Client SHOULD notify its support for CACHE_DIGEST frames by sending
the SENDING_CACHE_DIGEST (0xXXX) SETTINGS parameter. the SETTINGS_SENDING_CACHE_DIGEST (0xXXX) SETTINGS parameter.
The value of the parameter is a bit-field of which the following bits The value of the parameter is a bit-field of which the following bits
are defined: are defined:
DIGEST_PENDING (0x1): When set it indicates that the client has a DIGEST_PENDING (0x1): When set it indicates that the client has a
digest to send, and the server may choose to wait for a digest in digest to send, and the server may choose to wait for a digest in
order to make server push decisions. order to make server push decisions.
Rest of the bits MUST be ignored and MUST be left unset when sending. Rest of the bits MUST be ignored and MUST be left unset when sending.
The initial value of the parameter is zero (0x0) meaning that the The initial value of the parameter is zero (0x0) meaning that the
client has no digest to send the server. client has no digest to send the server.
4. The ACCEPT_CACHE_DIGEST SETTINGS Parameter 4. The SETTINGS_ACCEPT_CACHE_DIGEST SETTINGS Parameter
A server can notify its support for CACHE_DIGEST frame by sending the A server can notify its support for CACHE_DIGEST frame by sending the
ACCEPT_CACHE_DIGEST (0x7) SETTINGS parameter. If the server is SETTINGS_ACCEPT_CACHE_DIGEST (0x7) SETTINGS parameter. If the server
tempted to making optimizations based on CACHE_DIGEST frames, it is tempted to making optimizations based on CACHE_DIGEST frames, it
SHOULD send the SETTINGS parameter immediately after the connection SHOULD send the SETTINGS parameter immediately after the connection
is established. is established.
The value of the parameter is a bit-field of which the following bits The value of the parameter is a bit-field of which the following bits
are defined: are defined:
ACCEPT (0x1): When set, it indicates that the server is willing to ACCEPT (0x1): When set, it indicates that the server is willing to
make use of a digest of cached responses. make use of a digest of cached responses.
Rest of the bits MUST be ignored and MUST be left unset when sending. Rest of the bits MUST be ignored and MUST be left unset when sending.
The initial value of the parameter is zero (0x0) meaning that the The initial value of the parameter is zero (0x0) meaning that the
server is not interested in seeing a CACHE_DIGEST frame. server is not interested in seeing a CACHE_DIGEST frame.
Some underlying transports allow the server's first flight of Some underlying transports allow the server's first flight of
application data to reach the client at around the same time when the application data to reach the client at around the same time when the
client sends it's first flight data. When such transport (e.g., TLS client sends it's first flight data. When such transport (e.g., TLS
1.3 [I-D.ietf-tls-tls13] in full-handshake mode) is used, a client 1.3 [I-D.ietf-tls-tls13] in full-handshake mode) is used, a client
can postpone sending the CACHE_DIGEST frame until it receives a can postpone sending the CACHE_DIGEST frame until it receives a
ACCEPT_CACHE_DIGEST settings value. SETTINGS_ACCEPT_CACHE_DIGEST settings value.
When the underlying transport does not have such property (e.g., TLS When the underlying transport does not have such property (e.g., TLS
1.3 in 0-RTT mode), a client can reuse the settings value found in 1.3 in 0-RTT mode), a client can reuse the settings value found in
previous connections to that origin [RFC6454] to make assumptions. previous connections to that origin [RFC6454] to make assumptions.
5. IANA Considerations 5. IANA Considerations
This document registers the following entry in the Permanent Message This document registers the following entry in the Permanent Message
Headers Registry, as per [RFC3864]: Headers Registry, as per [RFC3864]:
skipping to change at page 14, line 4 skipping to change at page 13, line 10
o Specification document(s): [this document] o Specification document(s): [this document]
This document registers the following entry in the HTTP/2 Frame Type This document registers the following entry in the HTTP/2 Frame Type
Registry, as per [RFC7540]: Registry, as per [RFC7540]:
o Frame Type: CACHE_DIGEST o Frame Type: CACHE_DIGEST
o Code: 0xd o Code: 0xd
o Specification: [this document] o Specification: [this document]
This document registers the following entry in the HTTP/2 Settings This document registers the following entry in the HTTP/2 Settings
Registry, as per [RFC7540]: Registry, as per [RFC7540]:
o Code: 0x7 o Code: 0x7
o Name: ACCEPT_CACHE_DIGEST o Name: SETTINGS_ACCEPT_CACHE_DIGEST
o Initial Value: 0x0 o Initial Value: 0x0
o Reference: [this document] o Reference: [this document]
6. Security Considerations 6. Security Considerations
The contents of a User Agent's cache can be used to re-identify or The contents of a User Agent's cache can be used to re-identify or
"fingerprint" the user over time, even when other identifiers (e.g., "fingerprint" the user over time, even when other identifiers (e.g.,
Cookies [RFC6265]) are cleared. Cookies [RFC6265]) are cleared.
skipping to change at page 17, line 10 skipping to change at page 16, line 14
Digest-Value is encoded using base64url [RFC4648], Section 5. Flags Digest-Value is encoded using base64url [RFC4648], Section 5. Flags
that are set are encoded as digest-flags by their names that are that are set are encoded as digest-flags by their names that are
compared case-insensitively. compared case-insensitively.
Origin is omitted in the header form. The value is implied from the Origin is omitted in the header form. The value is implied from the
value of the ":authority" pseudo header. Client MUST only send value of the ":authority" pseudo header. Client MUST only send
Cache-Digest headers containing digests that belong to the origin Cache-Digest headers containing digests that belong to the origin
specified by the HTTP request. specified by the HTTP request.
The example below contains one digest of fresh resource and has only The example below contains a digest of one resource and has only the
the "COMPLETE" flag set. "COMPLETE" flag set.
Cache-Digest: AfdA; complete Cache-Digest: AfdA; complete
Clients MUST associate Cache-Digest headers to every HTTP request, Clients MUST associate Cache-Digest headers to every HTTP request,
since Fetch [Fetch] - the HTTP API supported by Service Workers - since Fetch [Fetch] - the HTTP API supported by Service Workers -
does not define the order in which the issued requests will be sent does not define the order in which the issued requests will be sent
to the server nor guarantees that all the requests will be to the server nor guarantees that all the requests will be
transmitted using a single HTTP/2 connection. transmitted using a single HTTP/2 connection.
Also, due to the fact that any header that is supplied to Fetch is Also, due to the fact that any header that is supplied to Fetch is
required to be end-to-end, there is an ambiguity in what a Cache- required to be end-to-end, there is an ambiguity in what a Cache-
Digest header respresents when a request is transmitted through a Digest header respresents when a request is transmitted through a
proxy. The header may represent the cache state of a client or that proxy. The header may represent the cache state of a client or that
of a proxy, depending on how the proxy handles the header. of a proxy, depending on how the proxy handles the header.
Appendix B. Acknowledgements Appendix B. Changes
Thanks to Stefan Eissing for his suggestions. B.1. Since draft-ietf-httpbis-cache-digest-04
Appendix C. Changes o Remove ETag from the digest key calculations.
C.1. Since draft-ietf-httpbis-cache-digest-03 o Add SETTINGS_ prefix to parameter names.
B.2. Since draft-ietf-httpbis-cache-digest-03
o Yoav becomes an author; Mark steps down. o Yoav becomes an author; Mark steps down.
C.2. Since draft-ietf-httpbis-cache-digest-02 B.3. Since draft-ietf-httpbis-cache-digest-02
o Switch to Cuckoo Filter. o Switch to Cuckoo Filter.
C.3. Since draft-ietf-httpbis-cache-digest-01 B.4. Since draft-ietf-httpbis-cache-digest-01
o Added definition of the Cache-Digest header. o Added definition of the Cache-Digest header.
o Introduce ACCEPT_CACHE_DIGEST SETTINGS parameter. o Introduce ACCEPT_CACHE_DIGEST SETTINGS parameter.
o Change intended status from Standard to Experimental. o Change intended status from Standard to Experimental.
C.4. Since draft-ietf-httpbis-cache-digest-00 B.5. Since draft-ietf-httpbis-cache-digest-00
o Make the scope of a digest frame explicit and shift to stream 0. o Make the scope of a digest frame explicit and shift to stream 0.
Appendix C. Acknowledgements
+{:numbered="false"}
Thanks to Stefan Eissing for his suggestions.
Authors' Addresses Authors' Addresses
Kazuho Oku Kazuho Oku
Fastly Fastly
Email: kazuhooku@gmail.com Email: kazuhooku@gmail.com
Yoav Weiss Yoav Weiss
Akamai Akamai
 End of changes. 36 change blocks. 
117 lines changed or deleted 76 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/