Conversation
Brotli defaulted to level 11 (near-max), which is too slow for an HTTP response path. Set a fast, HTTP-sensible default of 4 and add an explicit Zstd default of 3. GZIP and Deflate have no public level setter in utopia-php/compression 0.1.4, so their PHP defaults (6) are left as-is. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR lowers the Brotli compression level from the library default (11) to 4 for better HTTP response throughput, and explicitly sets Zstd to its library default of 3 for clarity. Two new constants are added to Confidence Score: 5/5Safe to merge — changes are minimal, well-scoped, and follow existing patterns in the codebase. No logic errors or correctness issues found. The level values are within valid ranges for both algorithms, the instanceof guards are correct, setLevel is called before compress(), and the new constants follow the established COMPRESSION_MIN_SIZE_DEFAULT pattern. All remaining observations are P2 or below. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "Lower Brotli default compression level t..." | Re-trigger Greptile |
Summary
New constants on
Http:COMPRESSION_BROTLI_LEVEL_DEFAULT = 4COMPRESSION_ZSTD_LEVEL_DEFAULT = 3Applied in
Response::send()viainstanceofchecks againstBrotli/Zstdafter algorithm selection.Test plan
composer check(phpstan) passescomposer testpasses🤖 Generated with Claude Code