Subject: Re: [httpwg/http-extensions] define `cache-digest` header in appendix (#341)

From: HTTP issue updates <[email-masked]>
Date: Sun, 30 Apr 2017 18:27:03 -0700

mnot commented on this pull request.

> @@ -286,6 +287,37 @@ Additionally, User Agents SHOULD NOT send CACHE_DIGEST when in "privacy mode."
 
 --- back
 
+# Encoding the CACHE_DIGEST frame as an HTTP Header
+
+Some HTTP/2 protocol stacks do not provide an interface to inject arbitrary HTTP/2 frames while allowing the application to send additional HTTP request headers.

Isn't the motivation simply that browsers currently don't send CACHE_DIGEST, so you have to fake it with Fetch?

> +  Cache-Digest  = 1#digest-entity
+  digest-entity = digest-value *(OWS ";" OWS digest-flag)
+  digest-value  = <Digest-Value encoded using base64url>
+  digest-flag   = token
+~~~
+
+A Cache-Digest request header is defined as a list construct of cache-digest-entities.
+Each cache-digest-entity corresponds to a CACHE_DIGEST frame.
+
+Digest-Value is encoded using base64url {{RFC4648}}, Section 5.
+Flags that are set are encoded as digest-flags by their names that are compared case-insensitively.
+
+Origin is omitted in the header form.
+The value is implied from the value of the `:authority` pseudo header.
+Client MUST only send Cache-Digest headers containing digests that belong to the origin specified by the HTTP request.
+

Need to register the header field in IANA Considerations, as per RFC3864.

> @@ -286,6 +287,37 @@ Additionally, User Agents SHOULD NOT send CACHE_DIGEST when in "privacy mode."
 
 --- back
 
+# Encoding the CACHE_DIGEST frame as an HTTP Header
+
+Some HTTP/2 protocol stacks do not provide an interface to inject arbitrary HTTP/2 frames while allowing the application to send additional HTTP request headers.
+When using such an implementation, it is sensible to send Cache Digests as HTTP headers, even though doing so consumes more bandwidth when compared to using HTTP/2 frames due to the fact that the digests need to be associated to every HTTP request as opposed to just sending once per connection.
+
+For the sake of interoperability with clients that are constrained to using headers, this appendix defines how a CACHE_DIGEST frame can be encoded as an HTTP header named `Cache-Digest`.
+

It would be good to mention other limitations -- e.g., since the header is end-to-end, there might be confusion about what cache generated the header field.

> @@ -286,6 +287,37 @@ Additionally, User Agents SHOULD NOT send CACHE_DIGEST when in "privacy mode."
 
 --- back
 
+# Encoding the CACHE_DIGEST frame as an HTTP Header
+
+Some HTTP/2 protocol stacks do not provide an interface to inject arbitrary HTTP/2 frames while allowing the application to send additional HTTP request headers.
+When using such an implementation, it is sensible to send Cache Digests as HTTP headers, even though doing so consumes more bandwidth when compared to using HTTP/2 frames due to the fact that the digests need to be associated to every HTTP request as opposed to just sending once per connection.

It might be worth spelling out why they need to be sent on every request (since different requests might be routed differently; there is no connection affinity).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/pull/341#pullrequestreview-35531486

---

From: HTTP issue updates <[email-masked]>
Date: Sun, 30 Apr 2017 22:17:19 -0700

@kazuho pushed 1 commit.

fdb3b0b  address the issues pointed out by Mark

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/httpwg/http-extensions/pull/341/files/bab4e9d7fc637cdf9759a0b8db92d5569dfa1bbe..fdb3b0bb2ce79733dd581d5c664c6cebaf5154fa

---

From: HTTP issue updates <[email-masked]>
Date: Sun, 30 Apr 2017 22:18:53 -0700

kazuho commented on this pull request.

 --- back

I have adjusted the text so that it discusses specifically about Service Workers.

It is Service Workers (that provides a Cache _and_ the Fetch API) that we use to emulate Cache-Digests.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/pull/341#discussion_r114099514

---

From: HTTP issue updates <[email-masked]>
Date: Sun, 30 Apr 2017 22:20:32 -0700

Thank you for your review. I believe that I have addressed all four issues in the commit above.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/httpwg/http-extensions/pull/341#issuecomment-298287941