Brotli vs Gzip Compression

by | Last Updated Feb 23, 2021 | Performance and Optimisation | 0 comments

An excellent way to shrink your page sizes and speed up your WordPress site compresses your files.

Since the 90s, Gzip has been the golden standard for web file compression.

But Gzip is not the only compression method in usage now.

We have Brotli, a newer compression method from Google.

Google released in Brotli in late 2013 and is picking up steam.

When it comes to Gzip vs Brotli compression for your WordPress website, which compression should you be applying?

What does that comparison even mean? Or is either compression method excellent? Let’s find out!

Along with comparing both methods, we also show you how to use both Gzip or Brotli compression on your WordPress site.

Brotli vs Gzip Compression: The Differences

Both Gzip and Brotli are techniques to compress your website’s files. Brotli and Gzip are similar for their core purpose.

Of course, the difference is how they both go about compressing your site and how efficient they are.

Let us cover the basics of Brotli and Gzip first. Then we can compare performance benchmarks.

Gzip Compression

Gzip released on 31 October 1992.

Jean-loup Gailly and Mark Adler created the program and intended for use by GNU. Thus the name GNUzip or Gzip is short.

Since the 90s, Gzip has been the predominant format for web compression.

Even today, it retains that position.

DEFLATE algorithm is the base of Gzip compression.

There are different compressions in Gzip, though we refer to it as a single compression tool.

There is a total of nine quality levels that balance compression level vs speed in Gzip.

Level 1 has small file savings but the fastest compression speed.

Level 9 gives maximum file size reductions, but it is relatively slow in compression speed.

All major browsers support Gzip. And most web hosting providers, including Rovity, supports Gzip out of the box.

Brotli Compression

Brotli is much younger than Gzip. Software engineers from Google released Brotli on 15 October 2013. Until 2015 it didn’t focus on HTTP compression.

Can I Use Brotli

It took some time for adoption. All major web browsers supported Brotli in 2020.

Brotli also has different compression levels similar to Gzip. Brotli has eleven various levels that follow a similar pattern as Gzip.

Level 1 has small file savings but the fastest compression speed.

Level 11 gives maximum file size reductions, but it is relatively slow in compression speed.

Brotli vs Gzip Benchmarks: Who Performs Better?

All Good, let us ask the big question. Brotli vs Gzip compression – which produces better?

Here, let us see some public benchmark tests.

Before we drill down to the data, it is essential to know that there are multiple parts to web performance and compression.

Compression Ratio – this is how significant the file size savings are. A two MB file compressed to one MB is an example.

Compression Speed – this is how fast it takes to compress and decompress the file.

Compression Speed is vital for dynamic content that you require to compress on-the-fly.

Let Us Take a Look at the Data

Let us take a look at the content-delivery giant Akamai’s benchmark. Akamai listed the top 1,000 URLs. Then downloaded the HTML, CSS, and JavaScript files from the URLs.

Akamai compressed those files with both Gzip and Brotli methods.

Here are their benchmark results.

Brotli vs Gzip – HTML

  • Median Gzip Savings 78% 78%
  • Median Brotli Savings 82% 82%

Median Brotli Improvement Over Gzip is 21%

Brotli vs Gzip – JavaScript

  • Median Gzip Savings 63% 63%
  • Median Brotli Savings 68% 68%

Median Brotli Improvement Over Gzip is 14%

Brotli vs Gzip – CSS

  • Median Gzip Savings 79% 79%
  • Median Brotli Savings 82% 82%

Median Brotli Improvement Over Gzip is 17%

But the better result of the compression is more than just smaller file sizes.

How long it takes to finish the compression (Compression Speed) is also vital.

Akamai found that compression speed matters when the compression level we use.

At some levels, Gzip was faster.
At some levels, Brotli delivered faster results.

If you can tweak the Brotli settings a little bit, the compression speeds can surpass the speeds of Gzip. At the same time, Brotli provides some significant compression.

Akamai concludes their report.

OpenCPU also ran its benchmarks.

In terms of the compression ratio, Brotli was superior.

At on-the-fly compression, Gzip was much faster.

However, it is unclear how much they tweaked Gzip settings.

Hotel brand OYO improved its latency by 37%.

Does the Difference Matter?

The research data is specific that Brotli offers a better compression ratio than Gzip. Brotli compresses our website more than Gzip.

However, remember that it is not just about the compression ratio.

It is also about how long it takes to compress and decompress data. There, the difference is not quite as pronounced.

Overall the data suggest that:

Because of the superior compression ratio, Brotli is better at compressing static data.
Gzip often has superior compression speed. It is better at compressing dynamic data.

If you work around with the Brotli settings, you can get compression speeds competing with Gzip. You can also benefit from a better compression ratio.

Are you an ordinary WordPress user? If yes, I don’t think the Gzip vs Brotli debate is something you need to worry about much.

Thus you don’t need to invest your time heavily on thinking about both of them.

Yeah, it is essential to use some compression.

But for an average WordPress website, you don’t need to stress whether you are using Brotli or Gzip.

On WordPress, Gzip compression is much easier to use.

Because Gzip is almost universally utilized, it is a good starting point for most WordPress users.

Gzip gets your site the benefits of compression effortlessly.

How to Compress Websites With Gzip?

Suppose you are hosted with Rovity or using CDN like Cloudflare. In that case, your site is already benefiting from Gzip compression.

Gzip also enables popular cache plugins like WP Rocket and LiteSpeed out of the box.

Rovity, Cloudflare, or WP Rocket – all of them activate the Gzip compression automatically.

You don’t need to take any manual actions at all.

You can also activate GZIP compression by installing a WordPress Gzip compression plugin.

How to Enable Gzip Compression on WordPress?

Most of the WordPress performance and caching plugins include Gzip as part of their core feature.

Do you require a plugin that only focused on Gzip compression? Enable Gzip Compression; a free plugin is there for you.

Enable Gzip Compression

After the plugin is activated, go to Settings → Gzip Compression.

And click the Enable Gzip compression button.

That’s it! Your WordPress site now enjoys the Gzip compression.

How to Test Gzip Compression?

We have a simple way.

You can use Gzip / Brotli Compression Test tools from This tool will check Gzip/Brotli Compression and show you useful information.

Check Gzip or Brotli Compression

How to Use Brotli Compression on WordPress?

Applying Brotli compression on your WordPress site is a little complicated.

You need to pick a host that supports Brotli if you want to enable Brotli compression at a server level.

Almost every single host supports Gzip out of the box.

It is a bit hard to find a WordPress host that supports Brotli on shared or managed plans.

But don’t feel lost. Luckily, there is another option that works well for all websites.

Cloudflare Brotli Compression

You can enable Brotli compression with the click of a button if you use the Cloudflare CDN service.

To activate Brotli, go to the Speed Tab. And click on the Optimisation.

Cloudflare Brotli Compression

You can toggle On or Off here.

See more Cloudflare settings to boost your website performance.

How to Test Brotli Compression?

Well, have you connected your WordPress site to Cloudflare and enabled Brotli compression?

See the easy way to test if Brotli is working. Head over to KeyCDN’s Brotli test tool. And analyze your domain here.

Verify Brotli Compression Support

Brotli vs Gzip: Pick the One That’s Best for You

Both Gzip and Brotli help you compress your website’s files. Gzip is the older and more prominent of the two.

Brotli is newer but picking up slowly.

In some benchmarks, Brotli seems to outperform Gzip, primarily when you work around with its configuration.

For most WordPress users, Gzip is a better starting point.

What is your preferred compression mode? Let me know in the comments below.

If you enjoyed this tutorial, then you’ll love Rovity and our fast-growing premium shared hosting on the cloud. Check our subscription plans.

We engineered our cloud infrastructure with Performance, Speed, Scalability, and Security in mind.

That’s why we built Rovity with AWS, CloudLinux OS, DirectAdmin, and LiteSpeed Web Server.

Come and experience the next generation of shared hosting on the cloud

By Subitha K S

Subitha is a multi-tasker. A graphic designer, web designer, web developer.

Check Out These Related Posts



Submit a Comment

Your email address will not be published. Required fields are marked *