Brotli gzip WordPress

Why Google's "Brotli" compression algorithm is a real gzip alternative

Who wants to bake smaller rolls? - All WordPress professionals who want to deliver their website as quickly as possible. For some time now, a technology called Brotli has been very popular.

There are currently various compression methods. For a long time, gzip was the standard, but a new compression algorithm called Brotli is now taking its place. And not without reason! To ensure that your WordPress website keeps up with the times in terms of compression, Brotli is now standard at Raidboxes. But let's start from the beginning.

The 1 x 1 of data compression

Data compression is a technique in which the storage space of data is reduced as much as possible. This is because the smaller the volume used, the shorter the transfer time.

The reduction in size is achieved by compressing or reducing the data. In principle, the information is converted into a shorter form that takes up less storage space.

Compressing and unpacking are two processes, but the bottom line is that they are still faster than simply transferring large amounts of data.

Google as a bread baker

The previous compression standard on the Internet was gzip. This compression works with an algorithm called Deflate, which consists of a combination of the LZ77 technique and Huffman coding. Deflate has existed since 1993 and has since established itself as the absolute standard for HTTP transmissions.

But that wasn't enough for Google. In its endless efforts to improve the internet, the Silicon Valley giant developed the Zopfli algorithm (named after the Swiss yeast plait) a few years ago. Zopfli uses a similar technique to Deflate and is also compatible with its data format, but already has some improvements.

That was probably still not enough, because now there are Brotli - named after Brötli, Swiss bread rolls.

Brotli is an open source algorithm which, according to Google, represents a completely new data format. Compatibility with Deflate has now come to an end, but Brotli offers a number of other advantages.

Gzip vs. Brotli: Who will win the race?

So how much does Brotli save compared to the standard gzip method? Reports show a clear advantage:

  • With HTML, Brotli saves 21% more disk space than gzip.
  • The figure for JavaScript is 14%.
  • CSS is saved 17% smaller by Brotli than by gzip.

In principle, the difference in speed between the transfer of compressed and uncompressed data is already very large. Gzip already saves a lot of disk space compared to the initial situation. Brotli goes one better - even if the figures no longer look like massive savings compared to gzip.

Brotli offers particular advantages for mobile websites

Mobile devices and data tariffs in particular benefit from compression. Here, the available bandwidth is often much lower, so that a saving of just 20 percent results in a significantly better user experience. Web servers and devices may now be pretty fast - but the internet isn't always.

As more and more people access websites on the move and therefore benefit from the smaller size of Brotli files (for example, through reduced battery usage and lower transmission fees), Google hopes that the algorithm will become the new standard in the future.

Restrictions when baking bread

Despite these advantages, Brotli is not a jack of all trades. Probably also because the algorithm is quite young (Google introduced it in September 2015), you still have to put up with one or two limitations.

Precise configuration is important

However, file size savings are not the only yardstick by which a compression method must be measured. After all, you want to improve the performance of your website. The speed at which information is compressed and decompressed is also an important aspect. This is because it determines how quickly you see the results.

An incorrect configuration between memory saving and conversion speed can result in gzip being even faster than Brotli. Both gzip and Brotli have several quality levels (gzip nine and Brotli eleven).

So here it is a question of fine-tuning what you want to get out of your configuration. Test results show that Brotli at level 4 saves more memory and works even faster than gzip at level 6.

Brotli only works under HTTPS

Brotli only works with HTTPS connections. But to be honest, this is the standard these days anyway.

"*" indicates required fields

I would like to subscribe to the newsletter to be informed about new blog articles, ebooks, features and news about WordPress. I can withdraw my consent at any time. Please note our Privacy Policy.
This field is used for validation and should not be changed.

Brotli is perfect for static content

Another often-discussed sticking point is the compression of dynamic content. A quick refresher:

  • Dynamic content is only generated individually when you make a request, for example if you only want to display the entries of certain categories in a blog or select shirts of a certain brand in a certain size in an online store using the filter function. The content is of course only compressed once it has been generated.
  • Static content, on the other hand, is already compressed on the server and is delivered to all users in the same way.

The sticking point when compressing dynamic content: As long as the server is busy making the content smaller, you won't see anything at first. The data is only delivered once the compression is complete. And the better the compression is supposed to be, the longer it takes. Even with low compression rates, dynamic compression can limit performance. Static content, on the other hand, which is already compressed, can be delivered in no time at all when a request is made.

In practice, it has been shown that Brotli is more effective for static content if the algorithm is configured accordingly. For dynamic content, however, many still prefer gzip. Others argue that Brotli can also keep up with gzip for dynamic content.

Not all browsers support Brotli

As far as servers are concerned, NGINX and Apache (from version 2.5) support Brotli. Nowadays, almost all browsers are included. You can find out which browsers do not (yet) support Brotli as a compression standard at caniuse.com.

Why Google's "Brotli" compression algorithm is a real gzip alternative
Source: https://caniuse.com/brotli

If you still have to do without Brotli because of certain browsers, there is good news: the content will still be delivered to these users: In this case, gzip is automatically activated. So you don't have to worry that you won't be able to see anything at all.

Conclusion

Saving storage space, delivering websites faster and increasing performance: we are happy to be part of this. In my opinion, the advantages are obvious. With Raidboxes, you benefit directly: Brotli is built into the servers as standard.

Did you like the article?

With your rating you help us to improve our content even further.

Write a comment

Your e-mail address will not be published. Required fields are marked with *