The uncompressed version of the file is then compressed at each level for Gzip and Brotli.
This allows us to log the uncompressed file size, and whether gzip and brotli are currently supported. Once w/o an Accept-Encoding header, and then with Accept-Encoding:gzip header and finally with an Accept-Encoding:br header.
On the server side, the file will be downloaded 3 times.
Paste the URL for the object you want to test in the text box, and click the “Compression Test” button.
For example, you may want to choose the largest JS or CSS file on a page.
Find a URL that you want to test the compression levels for.
I’ve created a new tool which you can access here. How Much Will My Files Be Compressed With Brotli? This allows us to provide the most byte savings without the user incurring any processing delays. Brotli resources are only served from Akamai’s cache, and cache misses are precompressed prior to being served to an end user. Note: Akamai is able to compress to Brotli level 11 because of the way Resource Optimizer is architected. If not, then Brotli level 4 or 5 should provide a smaller payload than the highest gzip compression level, with a reasonable processing time tradeoff. If you are able to precompress resources, then Brotli level 11 is the way to go. Brotli compression levels 10 and 11 are far more computationally expensive – but the savings are significant. The same is true for Brotli, although the CPU costs are much higher compared to Gzip. When sites can afford to, compressing to Gzip level 9 will shave off a few more bytes. For example: Apache defaults to zlib’s default, which is level 6, IIS defaults to level 7, NGINX defaults to level 1. Many popular web servers default to a mid-range gzip level, because it compresses the file adequately while keeping CPU costs in check. The below graph, which was generated from Squash benchmark results, makes this very clear. The higher the compression level, the smaller the file (and the more computationally expensive the compression is). With both Gzip and Brotli, the compression levels start at 1, and increase. If you are not using Brotli today, have you ever wondered how much Brotli compression could reduce your content? Read on to find out!īoth Gzip and Brotli use multiple compression levels to indicate how aggressive the algorithms will work to compress a file. Based on both Desktop and Mobile data from the HTTP Archive’s June 2018 dataset, only 71% of text based compressible resources (html, javascript, css, json, xml, svg, etc) are actually being compressed! Of them, 11% are Brotli encoded and 60% are Gzip encoded. However, adoption across the web is still quite low. Despite Brotli being a completely different format from Gzip, it was quickly supported by most modern web browsers.īy mid-2016 some websites and CDNs started to support it. Later in 2015 it was released as a compression library to optimize the delivery of web content. The algorithm was created by Google, who initially introduced it as a way to compress web fonts via the woff2 format.
A few years ago Brotli compression entered into the webperf spotlight with impressive gains of up to 25% over gzip compression.