More Site Speed Gains with Brotli Compression Algorithm
More Site Speed Gains with Brotli Compression Algorithm
We are happy to announce that we have deployed and enabled by default the Brotli compression algorithm on our Site Tools servers so websites hosted there could get up to 15-20% speed gains from using it.
What is Brotli?
Brotli is a next generation compression algorithm developed by Google as a successor to the popular gzip method that we’ve had running on our servers for ages. The idea is simple – once your application produces the HTML output of your website and the output is compressed together with all the resources it loads, the data is transmitted over the Internet and then the browser decompresses the content before rendering it. This process significantly reduces the size of data that’s been moved from the server to the visitor, resulting in speed gains multiple times bigger than the milliseconds lost for compression and decompression.
How much faster is Brotli compared to gzip?
The new algorithm provided by Brotli compresses the website into smaller data size, which makes it faster to transfer. JavaScript files compressed with Brotli are roughly 15% smaller than the ones compressed with gzip. HTML files are around 20% smaller and CSS files get around 16% size reduction. Those numbers of course will differ depending on your particular files.
A test with one of the WordPress’s default themes – TwentyTwenty shows that it produces a 19584 bytes of data uncompressed, 6003 bytes compressed with gzip and only 4863 bytes when compressed with Brotli! This means that you get more than 75% reduction in size from uncompressed content and 19.5% from gzip.
How to use Brotli?
We have enabled Brotli on all our Site Tools servers and if your account is hosted on one of these, your site will automatically take advantage of it. You don’t have to do anything to get it! 🙂 Browsers that support Brotli compression, which are the majority of the browsers now, pass the appropriate “accept-encoding: br” header when performing the request and get the Brotli-compressed content. Older browsers that don’t support it will be served with gzip-compressed data. If you are still hosted on a cPanel server, don’t worry – we expect migrations to Site Tools to be completed by the end of March 2021 so you won’t have to wait long to get it as well.