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

Override default brotli compression level 11 -> 4 #356

Merged
merged 2 commits into from
Jul 19, 2023

Commits on Apr 14, 2023

  1. Override default brotli compression level 11 -> 4

    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.
    Ameobea committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    5e578a0 View commit details
    Browse the repository at this point in the history
  2. Update compression test to manually choose best compression level

     * The test code was built assuming that brotli would be running using best compression level.  Since this is no longer the case by default, the test code has been updated to set it manually.
    Ameobea committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    a929193 View commit details
    Browse the repository at this point in the history