Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept-Encoding in Variants #390

Open
irori opened this issue Feb 5, 2019 · 2 comments
Open

Accept-Encoding in Variants #390

irori opened this issue Feb 5, 2019 · 2 comments

Comments

@irori
Copy link
Collaborator

irori commented Feb 5, 2019

When fetching a Signed Exchange, Chromium sets Accept-Encoding request header to gzip, deflate, br. However, actually Chromium accepts differnt set of content encodings for Signed Exchange's outer and inner responses. gzip, deflate, and br are supported for outer responses, and only mi-sha256-03 is supported for inner responses.

This is problematic when performing the Request Matching. For example if exchange has:

 Variants: Accept-Encoding;mi-sha256-03
 Variant-Key: mi-sha256-03

It will not match the browserRequest which has Accept-Encoding: gzip, deflate, br.

What should we do?

Ideas:

  • When making a redirect to the inner response, overwrite the request's Accept-Encoding header to mi-sha256-03.
  • Or, specify that Cache Behavior for Request Matching does not support Accept-Encoding content negotiation, because it makes little sense for signed exchange's inner responses (?)
@jyasskin
Copy link
Member

jyasskin commented Feb 9, 2019

In the long run, I think it'll be useful to support encoded inner responses in bundles to optimize local disk storage. Since signed exchanges don't need to be random access, it's less important to support compressing the inner response if that makes the implementation trickier.

In the short run, I think it'd be fine to say that seeing Accept-Encoding in the Variants header results in a mismatch from https://wicg.github.io/webpackage/loading.html#request-matching. I won't get around to this in the next couple weeks.

@jimmywarting
Copy link

I think it'll be useful to support encoded inner responses in bundles to optimize local disk storage. Since signed exchanges don't need to be random access

👍

it don't make any since to (de)encode things like video and images that are already compressed... So it would be wasteful to compress the hole web bundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants