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.
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.
As always, If you have any questions or concerns about any of the topics mentioned in this article, please feel free to reach out to support. Live chat and ticket support are available 24/7.