Definition

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.

Illustration of how the compression algorithm brotli works

Overview

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.

In comparison to gzip, brotli is around 20% more performant when it comes to compressing files such as HTML, CSS and JavaScript. In addition, Google, the creator of brotli, says that it’s 20-26% more performant than the other compression algorithm it made called zopfli. Because brotli was open-sourced by Google, the entire online community can benefit.

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

  1. A user accesses a website or web application running on a server that supports brotli
  2. The browser notifies the server about what kind of content it can decompress by using the Accept-Encoding header
  3. The server decides which kind of compressed content to deliver based on the compression algorithms contained in the request
  4. The server sends a Content-Encoding header to the browser, indicating the method used
  5. The browser decompresses the data before displaying it on the page

Conclusion

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.

  • Was just reading up on this, does MaxCDN support this or is there a roadmap / ETA for this?

    • Hey Patrick. Good seeing you in the comments again. This will be one of our next releases, hopefully coming in the next few weeks. If you want updates as I get them, feel free to message me at rgibb at maxcdn dot com. I’m more than happy to keep you posted.

      • Hi Robert, yeah Im sticking around for sure. Love the way MaxCDN helped me with some small issues in regard to enabling http2 and overall of course performance is great.

        Cool to hear that it will be in the upcoming weeks perhaps already. Like the open communication from your end aswell! I’ll check back in a month or so in this regard and if needed reach out 🙂

      • Is this still on the roadmap as an upcoming feature in the upcoming weeks?

        • Working to find you an answer 🙂

        • We are currently in the midst of something big so this is taking a back seat for now. We do still plan on releasing it – just not sure when. Apologies for the lack of specificity.

          • No problem Robert, an answer is answer.
            Can you mention anything on the nex big thing? 😉

          • I can’t get into specifics. It’s worth the wait though! Should only be a few more weeks 🙂

      • Dallas79

        So… July 2017 now. Can’t find anything in MaxCDN documentation or the dashboard that indicates any movement on brotli support besides this post from over a year ago. Updates?