Struggling to tell your APIs from your CDNs? Read our comprehensive cloud computing glossary covering the most common terms.
< Back to glossary
Brotli is a high-efficiency, lossless data compression algorithm developed by Google in 2015. It is designed to reduce file sizes significantly, enhancing web performance by decreasing bandwidth usage and speeding up page load times. Brotli is widely used for compressing HTTP content and is supported by all major web browsers.
Preprocessing: Brotli begins by analyzing the input data to identify patterns and repetitions.
It uses a predefined dictionary of over 13,000 common words, phrases, and substrings to replace frequently occurring sequences with shorter codes.
Compression: Brotli applies a combination of modern LZ77 compression, Huffman coding, and second-order context modeling to achieve high compression ratios.
It divides the input into meta-blocks, allowing different sections of the data to be compressed with unique parameters for optimal results.
Decompression: The compressed data is decoded using Huffman codes and backward references to reconstruct the original data. Since Brotli is lossless, the decompressed output is identical to the original input.
High Compression Ratios: Outperforms traditional algorithms like gzip by producing smaller file sizes.
Static Dictionary: Uses a predefined dictionary for common patterns, improving efficiency.
Adjustable Compression Levels: Allows users to balance between speed and compression quality (levels range from 1 to 11).
Faster Web Performance: Smaller file sizes result in quicker page loads, especially on slower networks or mobile devices.
Reduced Bandwidth Usage: Minimizes data transfer costs for websites and users.
Cross-Browser Support: Compatible with all major browsers like Chrome, Firefox, Edge, and Safari.
Compression Speed: Higher compression levels can take longer to process compared to gzip.
Resource Intensity: Requires more CPU power for optimal compression settings.
Limited Window Size: Its sliding window size (16 MB) may underperform on very large files.
A content delivery network (CDN) uses Brotli to compress static assets like JavaScript, CSS, and HTML files before delivering them to users. This reduces bandwidth consumption and ensures faster loading times for websites.