Brotli Compression Vs Gzip Compression

by | Last Updated Jan 9, 2020 | Performance and Optimisation | 0 comments

An excellent way to shrink your page sizes and speed up your WordPress site is to compress 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 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?

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 in 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 in 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 levels of 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 Host My Website Online 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.

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 form the URLs.

Akamai compressed those files with both Gzip and Brotli methods.

Here are their benchmark results.

HTML

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

Median Brotli Improvement Over Gzip is 21%

JavaScript

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

Median Brotli Improvement Over Gzip is 14%

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 their 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 clear 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 have superior compression speed. It is better at compressing dynamic data.

If you work around with the Brotli settings, you can get compression speeds competing 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 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 about whether you are using Brotli or Gzip.

On WordPress, Gzip compression is much easier to use.

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

Gzip get your site the benefits of compression effortlessly.

How to Compress Websites With Gzip?

If you are hosted with Host My Website Online or using CDN like Cloudflare, then your site is already benefiting from Gzip compression.

Popular cache plugins like WP Rocket is also enabled Gzip out of the box.

Host My Website Online, 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.

After the plugin 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 Varvy’s Gzip compression tester to make sure Gzip is enabled and working as expected.

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

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 test your domain here.

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.

Want to See Your WordPress Website Loads in a Second?

We offer a 30 Day Money Back Guarantee, so joining is Risk Free

By Subitha K S

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

Check Out These Related Posts

0 Comments

0 Comments

Submit a Comment

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