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!
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 is used the Brotli compressor?
How to check if your WordPress files are compressed with Brotli
When requesting page resources your server and browser exchange headers in order 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 case, 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 better than Gzip?
Brotli outperforms Gzip in Speed and Compression, and it’s supported by most browsers.
Brotli is 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:
- 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
Brotli support needs to be enabled on your website’s server for it to actually work.
If you do not have Brotli compression with your current hosting provider and want to test it right now:
We at wetopi give you FREE Development Servers, Brotli ready and finely tuned to serve WordPress at lighting speed.Signup in 10 seconds and get your free wetopi account
Enabling Brotli for your server can be a matter of minutes or hours, depending on your technology stack. 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, Brotli is supported and enabled by default.
At wetopi, we want to minimize the friction that every professional face when working and hosting WordPress projects.
In short, we are just techies passionate about WordPress. With wetopi, a specialized WordPress hosting, we want to go further to offer professionals and agencies a platform to work efficiently and effectively.
Not a wetopi user?
Free full performance servers for your development and test.
No credit card required.