-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Switch to Brotli from Gzip #76
base: master
Are you sure you want to change the base?
Conversation
JohnnyFangJr
commented
Jan 8, 2022
- Add a column for Brotli. I think it has wide-enough usage for static assets that it should be listed.
- Use max compression level for Gzip. Static assets are "pay once to compress", so there's no downside to max compression level.
Thanks for the PR @JohnnyFangJr! Those are great contributions. Happy to accept the Gzip max compression level change if you don't mind pulling that out into a separate PR. I'm not sure about displaying both Gzip and Brotli because it doesn't fit the page width and it adds more complexity to reading the table. The data should also be less about comparing compression algorithms, and more about showing how compressible the minified output is so I think just showing one of them is enough. I'm currently leaning towards replacing Gzip with Brotli because that's what the standard is today. Sadly major services like Fastly (used by GitHub for example) don't even support Brotli yet, so I'm worried this will make the data less relevant/practical. Do you have any data on the adoption of Brotli vs Gzip? I couldn't find any from a quick Google, but that might make this decision easier. |
Fastly doesn't "do the work for you" where you can upload the uncompressed assets and they'll create the GZip version for you, but enable one to do it manually on their own. But I'm guessing your question is about bottom-line real world usage. I agree about having more than one compression algorithm being bad - the whole table becomes noisy. Whereas the existing one is crisp clean and concise. I'll separate using max compression into a different PR. |
Thanks for sharing that link! Very useful, and seems recent too. It's been a few days now but let me know if you're still planning to separate out the Gzip max compression to a separate branch. Afterwards, this branch can be updated to replace Gzip with Brotli and I can build it to keep a reference. |
I updated this branch along with the title so you'll have it for future reference. |
Thanks so much @JohnnyFangJr ! 🙌 |
Both Cloudflare and Fastly don't provide information on which gzip compression level they are using. Cloudflare uses level 5 Brotli compression (see https://blog.cloudflare.com/brotli-compression-using-a-reduced-dictionary/). Terraform for Fastly VCL uses gzip level 3 as its default value (see https://registry.terraform.io/providers/fastly/fastly/latest/docs/resources/service_vcl) Fastly also provide a Chrome extension chrome-extension-estimate-compression-level. If you test the extension on GitHub Pages (which is using Fastly), the estimate gzip level is 5. So IMHO, we should set the compression level close to the real-world configuration (which should be 5), not the max. |
at the very least i feel like the compression level should be stated also the cloudflare and fastly compression level could probably be figured out by comparing local compression levels to whatever they're doing |
If I can add grist to the mill, here are the levels choosed by deno:
|
6656515
to
f3004a1
Compare