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

Changing the default quality level #93

Open
daxpedda opened this issue Mar 21, 2023 · 1 comment
Open

Changing the default quality level #93

daxpedda opened this issue Mar 21, 2023 · 1 comment

Comments

@daxpedda
Copy link

At the moment the default quality level when encoding is 11, when using BrotliEncoderParams::default(), see source.

I was wondering if there is any interest in changing the default to something more reasonable, as 11 is the highest and takes an extremely long time.

Ameobea added a commit to Osmos-io/tower-http that referenced this issue Apr 14, 2023
The `brotli` crate used by `async-compression` has a default compression level of 11, which is the maximum for brotli.  This causes extremely slow compression performance for many response bodies and is definitely an inappropriate compression level for dynamic content.

There's currently an open issue (dropbox/rust-brotli#93) on the `brotli` crate's repo to change this default, but it hasn't happened at this time.

This change adds a special case to convert a provided compression level of default to a compression level of 4, which is a reasonable default for dynamic content.
jplatte pushed a commit to tower-rs/tower-http that referenced this issue Jul 19, 2023
The `brotli` crate used by `async-compression` has a default compression level of 11, which is the maximum for brotli.  This causes extremely slow compression performance for many response bodies and is definitely an inappropriate compression level for dynamic content.

There's currently an open issue (dropbox/rust-brotli#93) on the `brotli` crate's repo to change this default, but it hasn't happened at this time.

This change adds a special case to convert a provided compression level of default to a compression level of 4, which is a reasonable default for dynamic content.
gezihuzi pushed a commit to gezihuzi/tower-http that referenced this issue Jul 19, 2023
The `brotli` crate used by `async-compression` has a default compression level of 11, which is the maximum for brotli.  This causes extremely slow compression performance for many response bodies and is definitely an inappropriate compression level for dynamic content.

There's currently an open issue (dropbox/rust-brotli#93) on the `brotli` crate's repo to change this default, but it hasn't happened at this time.

This change adds a special case to convert a provided compression level of default to a compression level of 4, which is a reasonable default for dynamic content.
@JorritSalverda
Copy link

Cloudflare found level 4 to offer the best balance between compression and speed: https://blog.cloudflare.com/this-is-brotli-from-origin#brotli-compression-to-11. Any chance this can get updated in this crate?

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