trillium-compression-v0.3.0
·
132 commits
to main
since this release
Changed (breaking)
- Default brotli level lowered from
Level::Default(quality 11) to
Level::Precise(4), matching common reverse-proxy transport defaults.
Quality 11 is roughly 100× slower than quality 4 for marginal size gains
and is unsuitable for the response hot path. Callers that want maximum
compression can opt back in withwith_brotli_level(Level::Best). - Encoders are now constructed with
with_quality(...)instead ofnew()
so the configured level is actually applied per request.
Added
with_brotli_level,with_gzip_level,with_zstd_levelfor per-algorithm
level configuration.Levelis re-exported fromasync-compression.
Fixed
- Skip compression when the response already has
Content-Encodingset.
Previously the middleware would re-compress precompressed sidecar
responses, producing invalid output and explosive memory use under any
concurrency. - Skip compression for content types that are already compressed (image
binary formats, video/, audio/, web fonts, common archive formats).
image/svg+xmlandapplication/wasmare intentionally still compressed.