GZip and Brotli are two different compression methods that significantly reduce the file sizes for static files and thus ensure better overall performance of the website. GZip is the original and is supported by almost all browsers. Brotli is more modern, can compress files with better efficiency, but only works with newer browser versions. For NGINX there are two ways to deliver the compressed files:
- on-the-fly or
- as pre-compressed version
On-the-fly means that NGINX compresses the static files (e.g. HTML/CSS/JS files) again with every call and then delivers them to the website visitor. However, in the high-performance domain, this costs quite a bit of valuable CPU power, especially for Brotli. The use of pre-compressed versions, where NGINX only has to deliver the files, is therefore a clear plus in terms of the overall performance of the server and, of course, of each individual web page.
Our server scripts automatically create the .gz and .br Versions of all HTML/CSS/JS files in the folders wp-content/cache and wp-content/uploads/cache. This way we get the maximum out of both compression methods and the website visitor will automatically get the size optimized version delivered by the web server.