June 7, 2016
Brotli is an open source, lossless data compression algorithm with a better compression density than gzip that reduces bandwidth consumption and helps content load faster.
Modern websites and web applications have become more demanding. Web pages now weigh more than ever and bandwidth consumption is at an all-time high. Mobile data traffic alone is expected to go from 6.2 Exabytes per month in 2016 to 30.6 Exabytes per month in 2020. These forecasts represent a need for new compression technology that minimizes bandwidth usage and keeps the web fast.
How Brotli Is Engineered
Brotli uses Huffman coding and a variant of the LZ77 algorithm which allows it to create a sliding window for backreferences. While gzip uses a fixed window of 32KB, Brotli uses a sliding window between 1KB and 16MB. This means that Brotli is able to optimize CWND and RWND and deliver larger, compressed files more efficiently. It also reuses entropy codes and adds a static dictionary that can be referenced from anywhere in the stream.
How Brotli Works
- A user accesses a website or web application running on a server that supports brotli
- The browser notifies the server about what kind of content it can decompress by using the
- The server decides which kind of compressed content to deliver based on the compression algorithms contained in the request
- The server sends a
Content-Encodingheader to the browser, indicating the method used
- The browser decompresses the data before displaying it on the page
Because brotli is open source, it’s freely available as a server add-on to web hosting providers and content delivery networks (CDNs), as well as individuals and businesses that manage their own servers. Supporting this new compression algorithm doesn’t only save customers of hosting providers and CDNs on bandwidth costs; it also speeds up page load time across the web.
As new compression algorithms like brotli emerge, it becomes vital for server owners to adopt them. Doing so helps de-clutter and optimize content delivery over the Internet. However, browsers must support this technology as well. To see which browsers currently support brotli, check out this resource.