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

Always set vary: accept-encoding when compression is enabled #1529

Closed
tanguilp opened this issue Jul 24, 2021 · 2 comments
Closed

Always set vary: accept-encoding when compression is enabled #1529

tanguilp opened this issue Jul 24, 2021 · 2 comments
Milestone

Comments

@tanguilp
Copy link

When compression is enabled, cowboy only sets accept-encoding in the list of headers of the vary header when content is actually compressed.

That is, a response to a request without the Accept-Encoding header will not contain vary: accept-encoding.

As far as I understand, it means for HTTP caches that the response to such a request can be returned even when the Accept-Encoding header is set. As a result, an HTTP cache could return a uncompressed response to an HTTP client that sets the Accept-Encoding header, which is suboptimal.

Not 100% sure about my interpretation of the RFCs here, some links that may help:

@tanguilp
Copy link
Author

@essen
Copy link
Member

essen commented Jan 8, 2024

Good catch, we should always set it. Now the compress handler will always add vary: accept-encoding.

@essen essen closed this as completed Jan 8, 2024
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

2 participants