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

Look for all accepted encodings for precompressed files #438

Closed
1 task done
kobutri opened this issue May 10, 2024 · 2 comments · Fixed by #439
Closed
1 task done

Look for all accepted encodings for precompressed files #438

kobutri opened this issue May 10, 2024 · 2 comments · Fixed by #439
Labels
enhancement New feature or request v2 v2 release
Milestone

Comments

@kobutri
Copy link
Contributor

kobutri commented May 10, 2024

Search for duplicate feature request

  • I already searched, and this feature request or improvement is not a duplicate.

Feature scope

Improve existing functionality

Feature request related to a problem

Browsers like Chrome don't provide a relative quality factor for the Accept-Encoding header, but use a fixed order, that does not necessarily express the preference of the browser, but is more likely to ensure backwards compatibility with older web servers. The static-web-server however only checks whether a precompressed file exists for the most preferred, i.e. first accepted encoding.

Describe the solution you'd like

Keep the same ordering by quality, but look for precompressed files in all accepted encoding standards.

Describe alternatives you've considered

If no quality order is provided in the header, it might be useful to have the web server choose a quality order, e.g. for precompressed files, based on file size.

Build target

All targets

Additional context

No response

@joseluisq
Copy link
Collaborator

Browsers like Chrome don't provide a relative quality factor for the Accept-Encoding header, but use a fixed order, that does not necessarily express the preference of the browser, but is more likely to ensure backwards compatibility with older web servers. The static-web-server however only checks whether a precompressed file exists for the most preferred, i.e. first accepted encoding.

Is there any reference from Chrome docs about this behavior that you can share?
How about also other browsers do they behave the same?

@joseluisq joseluisq removed the help wanted Extra attention is needed label May 16, 2024
@joseluisq joseluisq added this to the v2.31.0 milestone May 16, 2024
@kobutri
Copy link
Contributor Author

kobutri commented May 21, 2024

Is there any reference from Chrome docs about this behavior that you can share? How about also other browsers do they behave the same?

As far as I can tell, they are almost the same.
Chrome: gzip, deflate, br
Firefox: gzip, deflate, br, zstd
Safari: gzip, deflate, br

This was tested on MacOS.

I looked into the chrome a bit further. It always puts them in the same order. source coude
Zstd, will also be enabled soon https://chromestatus.com/feature/6186023867908096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2 v2 release
Projects
None yet
2 participants