Compressing your WordPress site’s files is a great way to shrink your page sizes and speed up your site. For a long time, GZIP compression has been used by web servers to deliver your site content compressed to the browser. Now Brotli is the new player!
Learn how to get Brotli Compression for your WordPress.
Table of Contents
- What Is Brotli
- Where we use the Brotli compressor?
- How to check if your WordPress is serving Brotli compressed files
- Is Brotli for WordPress better than Gzip?
- Enabling Brotli compression
What Is Brotli
Brotli is an open-source generic-purpose lossless data compression algorithm. Brotli was developed in 2013 by Google under the MIT license.
As a general-purpose lossless compressor, it can effectively compress any type of file without destroying data.
You can check Broti repo evolution in Github
Where we use the Brotli compressor?
How to check if your WordPress is serving Brotli compressed files
When requesting page resources your server and browser exchange headers to agree in the compression method. The agreement has two stages:
- The browser sends a header telling the server it accepts compressed content (gzip and deflate are two compression schemes):
accept-encoding: br, gzip, deflate
This “Accept-encoding” header is just a request by the browser, not a demand.
- The server sends a response if the content is compressed:
In this example, the content travels compressed with Brotli.
You can observe these exchanged headers using the Chrome Developer Tools.
This image shows you the
"content-encoding: br” of our wetopi home page:
Is Brotli for WordPress better than Gzip?
Yes, Brotli outperforms Gzip in Speed and Compression, and in addition it’s supported by most browsers.
Brotli has a faster compression algorithm:
- It compresses and decompresses data faster than other compression algorithms.
- Compressing data using Brotli uses fewer CPU resources.
Brotli also has a better compression ratio:
The Akamai benchmark showed that the:
- Median Brotli savings was 82%
- Median Gzip savings was 78%
More specifically, Akamai found that Brotli was:
- 21% better at compressing Html
- 17% better at compressing Css
Enabling Brotli compression
If you want Brotli compression, you have to enable it in your website’s server.
Enabling Brotli for your server can be a matter of minutes or hours, depending on your technology stack.
If you do not have Brotli compression with your current hosting provider and want to test it right now:
With Wetopi you get FREE Development Servers, Brotli ready,Signup in 10 seconds and get your free wetopi account
and finely tuned to serve WordPress at lighting speed.
There is no unique solution. But don’t worry, we have curated a few links pointing to guides that describe how to get Brotli up and running for the most popular servers:
- The official google nginx Brotli module repo with install instructions.
- How To Enable Brotli Compression In Apache by bash-prompt.net
- Beginning with LiteSpeed Web Server version 5.2, you have Brotli support enabled by default.
At wetopi, as a WordPress exclusive hosting, we know how a slow website can impact your business, and that’s why we focus on the latest technologies to improve performance. You can learn more on how to get Better WordPress performance and security with TLS 1.3 and how to Improve WordPress site speed with Cloudflare.
We are techies passionate about WordPress. With wetopi, a Managed WordPress Hosting, we want to minimize the friction that every professional faces when working and hosting WordPress projects.
Not a wetopi user?
Free full performance servers for your development and test.
No credit card required.
This might also interest you: