Skip to content

Add brotli compression of static assets #1862

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

Merged
merged 1 commit into from
Mar 16, 2024
Merged

Conversation

Zentrik
Copy link
Contributor

@Zentrik Zentrik commented Mar 16, 2024

Let me know if the rust code isn't idiomatic. This achieves a 200kb reduction in compare.js size from ~292kb to ~77kb.

Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

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

This is a great idea! #1201 enabled compression on-the-fly, but since our webserver is not very powerful, and on-the-fly compression provides much worse results with the current options (the compare.js script still has more than 200 KiB), and we already bake static assets into the binary, this seems like a great way to reduce payload size.

I left some comments about the implementation.

@Zentrik Zentrik force-pushed the brotli branch 2 times, most recently from eaad923 to 50991a4 Compare March 16, 2024 12:54
200kb reduction in compare.js size from 277kb to 77kb.
Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

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

Awesome, and the code is now shorter too! Thanks a lot :)

@Kobzol Kobzol merged commit 8de4945 into rust-lang:master Mar 16, 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

Successfully merging this pull request may close these issues.

2 participants