Brotli vs GZIP: Which Compression is Better for WordPress?
If not handled and managed properly, your website files such as images, fonts, and even code files like Javascript and CSS are known to fill up and overload website space. In turn, this can significantly decrease your website’s speed and overall performance. And consequently, poor website performance can only result in people abandoning your site altogether, quite often without ever going back.
Now, there are different ways in which you can take control of your website speed despite having tons of files on your site, and one of the most efficient ways is to compress your website files using the compression method such as GZIP or Brotli. But the real question is – how do you know which compression to choose?
While GZIP compression has been around for longer and is considered the web compression standard by many, the newest, Brotli compression method has quickly risen to popularity over the past few years. This time around, we will compare the Brotli vs GZIP method, talk about the benefits (and drawbacks) of each one, and help you determine which option is better for compressing your own WordPress files, so make sure to read on:
GZIP is a popular open-source compression and decompression method that first appeared way back in the ‘90s (in 1992, to be exact). It has been the leading format for compressing files ever since then, with the majority of websites still preferring to use it today. This compression method is best suitable for encoding data such as text files, Javascript or CSS codes, and other HTTP content.
GZIP works by decreasing the size of the file up to 80 percent while not jeopardizing its quality – similarly to programs like Photoshop that optimize images for the web without diminishing the quality of the pictures in any way. It uses nine different levels of file compression, with level one being the smallest file saving (and fast compression speed), and level 9 creating maximum file savings but being the slowest in performing the actual compression.
Created by Google, Brotli is a newer compression method than GZIP. It was originally released in the year 2013 and has quickly grown in popularity since then. Also, ever since 2019, it has been supported by all relevant web browsers, so it has quickly become one of the most widely used methods for compressing website files together with GZIP. Brotli has 11 different compression levels, with level 1 being the fastest but used for small file savings and level 11 used for maximum savings and slower compression speed.
When it comes to the popularity of these two tools, the use of GZIP has been more widespread due to its longevity and relevance over the years. Still, when putting the two methods against one another, some could argue that Brotli has better performance overall.
Namely, Brotli offers bigger compression capabilities, allowing you to save up more space in comparison. It has eleven levels of compression, which is two levels more than GZIP, which has 9 levels. This especially makes a difference if you own a huge website with tons of coding in place.
That being said, the downside of Brotli is that it takes longer to compress the files compared to GZIP. So, while Brotli does make files smaller when higher levels of compression are used, the minifying process will take longer than it will take GZIP to do the same. Also, the process of using Brotli does require you to be a bit of an experienced WordPress user. First of all, if you want to use Brotli, you also have to use a hosting provider that supports it. That being said, if you’re using a CDN service on your WordPress site, like Cloudflare, then setting up Brotli in WordPress should be much easier than if you were to attempt to do it manually.
So, it’s safe to say that GZIP is significantly better when it comes to the general compression speed, while Brotli offers a more “thorough”, or deeper compression than GZIP. In fact, some would argue that Brotli is better used for compressing static website data since it has the ability to compress at a deeper level than GZIP. On the other hand, GZIP is superior when it comes to shrinking dynamic data due to its speed.
All in all, it’s safe to say that both Brotli and GZIP have their upsides and downsides. GZIP has managed to uphold its good reputation and has remained the most popular compression method for over two decades. It offers 9 different compression levels and it’s definitely superior to the two when it comes to its compression and decompression speed.
That being said, Brotli easily takes the lead in the area of in-depth compression, or rather, it offers a better compression ratio and allows you to save up more space in the process, especially when using the higher compression levels. The downside of this is that it takes Brotli longer to finish compressing the files compared to GZIP.
Conclusion
As a WordPress user, which method you will go for depends entirely on your personal preferences and the size of your site. Brotli offers a more comprehensive compression of your files and works well for bigger sites with tons of files. We do have to mention, however, that GZIP is easier to use since it’s been around for longer. So, if you’re a complete beginner and don’t have too many files on your site, or you don’t plan to use services like Cloudflare, you might want to consider using GZIP instead. We’ve got a separate article that talks about how to easily enable GZIP compression in WordPress, if you do decide to go with this compression method, we do recommend that you check it out.