Brotli is a lossless compression algorithm, identified by the br content encoding. It uses a built-in dictionary of common web strings, which helps it beat gzip on HTML, CSS and JavaScript.
Why it matters
Smaller responses transfer and parse sooner. Brotli commonly saves roughly 15 to 25 percent over gzip on text assets at its higher settings, although the exact gain varies by file. Browsers advertise support with Accept-Encoding: br, and in practice they do so only on HTTPS connections.
The catch is CPU cost. High levels (10 and 11) are slow, so the best use is precompressing static files at build time. For dynamic responses, moderate levels such as 4 to 5 balance speed and size.
Example
Request: Accept-Encoding: gzip, deflate, br
Response: Content-Encoding: br
main.js original 420 KB gzip 118 KB brotli 99 KB
These numbers are illustrative; real results depend on the content.
Common mistakes
- Using maximum level compression for every dynamic response, which raises time to first byte.
- Enabling Brotli but forgetting to keep gzip as a fallback for older clients.
- Assuming the CDN compresses origin responses. Check the actual
Content-Encodingheader.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.