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

Pass Accept-Encoding header to origin #356

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

jdno
Copy link
Member

@jdno jdno commented Oct 23, 2023

The Accept-Encoding header is now passed to the origin so that it can respond with compressed responses.

This fixes an inconsistency with the backend, which prefers Brotli compression while CloudFront prefers gzip. Because the header is now passed to the origin, the Brotli-compressed response from the origin is passed through to the client. Previously, CloudFront would fetch uncompressed resources and compress them on the fly using gzip.

cc @Turbo87

The Accept-Encoding header is now passed to the origin so that it can
respond with compressed responses.

This fixes an inconsistency with the backend, which prefers Brotli
compression while CloudFront prefers gzip. Because the header is now
passed to the origin, the Brotli-compressed response from the origin is
passed through to the client. Previously, CloudFront would fetch
uncompressed resources and compress them on the fly using gzip.
@jdno jdno requested a review from Mark-Simulacrum October 23, 2023 11:22
Copy link
Member

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this does not apply to the /assets behavior, since we discovered that this behavior never worked because /assets refers to a fixed path, while /assets/* would have been the correct path pattern... 😅

Passing the header for the regular behavior is still useful for robots.txt and other top-level files though.

jdno added a commit to jdno/rust-simpleinfra that referenced this pull request Oct 23, 2023
The custom cache behavior for `/assets` was never used, since the
pattern matches only the specific `/assets` URL and not any resources
served under it (e.g. `/assets/foo`). This was discovered while
investigating the inconsistencies in rust-lang#356.

Since the configuration was never used in the first place, we are
removing it to remove some complexity.
@jdno jdno merged commit ccf91e8 into rust-lang:master Oct 23, 2023
3 checks passed
@jdno jdno deleted the pass-encoding-header branch October 23, 2023 12:20
jdno added a commit to jdno/rust-simpleinfra that referenced this pull request Oct 23, 2023
Two recent changes to the CloudFront configuration (rust-lang#356 and rust-lang#357) for
crates.io have been merged and deployed to both staging and production.
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

Successfully merging this pull request may close these issues.

3 participants