Overview
Brotli is a modern compression algorithm that is particularly effective for text-based web content. It uses a combination of a modern variant of the LZ77 algorithm, Huffman coding, and 2nd order context modeling.
Key Advantages
- Higher Density: Typically achieves 15-25% better compression than Gzip for CSS, HTML, and JavaScript.
- Static Dictionary: Includes a pre-defined dictionary of common web strings, allowing it to compress small files more effectively.
- Browser Support: Supported by all modern browsers.
Usage
Brotli is often used for static assets that can be pre-compressed at build time, as its highest compression levels can be computationally expensive for real-time server-side compression.