What is Brotli and how does it speed up my WordPress website?

Brotli is an open-source compression algorithm developed by Google to improve the speed and efficiency of data compression. It was introduced in 2015 and has since been increasingly adopted by web developers and users. Unlike other compression algorithms, such as Gzip, Brotli is able to achieve a higher degree of compression by using a more advanced compression technique. In many cases, Brotli can produce 20-30% smaller files than Gzip. This results in smaller file sizes and faster loading times for web pages and other data compressed with Brotli. Brotli is also more efficient than other compression algorithms, meaning it requires less CPU resources to compress and decompress data. This makes it suitable, for example, for use on servers where limited resources are available.

Which files does Brotli compress?

Brotli is a general-purpose compression algorithm that can be applied to a wide range of file types, such as HTML, CSS, JavaScript, JSON and other text files. But other files such as images, such as PNG and JPEG, can also benefit from Brotli’s compression technique. Unlike most compression algorithms that only compress text files, Brotli is also efficient for compression of semi-structured and arbitrary data, such as binary data. However, it is important to emphasize that not all files will benefit from Brotli compression, some files are already so small or already so compression efficient, that the chance that the compression will reduce the amount of file size is negligible. In fact, it is also advisable to be careful when compressing certain file types such as audio and video files, as these have already been compressed with a specific compression algorithm, and further compression may lead to loss of quality of the content or even deteriorated performance.

Which browsers support Brotli?

In terms of compatibility, most modern web browsers support Brotli compression, although some older browsers may not be compatible. Web developers can use Brotli by deploying it to the server where the website is hosted, or by using it in conjunction with a content delivery network (CDN). The most commonly used browsers such as Google Chrome, Safari, Firefox and Microsoft Edge support Brotli. For a comprehensive overview, you can see which other browsers support Brotli and how often these browsers are used via https://caniuse.com/brotli. Brotli support

How do I test if Brolti is enabled for my website?

Both the server and the client (browser) must be Brotli compatible to benefit from its operation. There are several ways to test whether Brotli is enabled. The easiest is to use websites such as:

Are there also disadvantages?

There are some disadvantages of using Brotli as a compression algorithm:

  1. Higher CPU load: Brotli requires more computing power to compress the data than some other compression algorithms, such as Gzip. This means that using Brotli on servers with limited resources may cause higher CPU usage.
  2. Longer compression time: Because Brotli uses advanced data compression techniques, it takes longer to compress data than some other algorithms. This can be a disadvantage for situations where fast processing is required.
  3. Less compatibility: Although Brotli is gaining support, it is not yet as widespread as some other compression algorithms such as Gzip, so there are still many browsers and servers that do not support Brotli. This may cause problems sending or receiving data through these unsupported browsers or servers. There are options to use Gzip as a fallback.
  4. Limited storage economy: As previously described, Brotli is not as compression efficient for certain types of files, such as already structured or already compressed files such as audio and video. This means that sometimes the compression can even lead to a larger file size instead of a smaller one.

Please note that using Brotli compression still has many benefits for specific use cases such as reducing file size and loading time for web pages, as it uses less bandwidth and faster download time for the user.

More information?

All in all, Brotli offers some distinct advantages over other compression algorithms, including smaller file sizes, faster loading times, and more efficient compression and decompression processes. It is therefore a popular choice for web developers looking for ways to improve the performance of their websites. Curious about the full comparison of Brotli, Deflate, Zopfli, LZMA, LZHAM and Bzip2 compression algorithms? then you can read the full paper here. This paper compares 6 different techniques and based on the results it can be concluded that Brotli can be used as a replacement for the well-known deflate algorithm. In addition, Brotli is shown to consume less CPU than Zopfli, LZMA, LZHAM and Bzip2.

Request a benchmark now

Do you feel like your website could be faster? Let us run a benchmark. We guarantee that your website will run faster on our hosting!