Brotli is a new compression algorithm that was developed by Google in order to help further reduce the size of files. This means less bandwidth is used to transfer files that take advantage of Brotli compression and visitors accessing these files receive them faster. Many studies such as Google’s Compression Algorithm Study have shown impressive compression results using Brotli. A 20-26% higher compression ratio has been seen when comparing Brotli to Zopfli (another modern compression algorithm). see also https://en.wikipedia.org/wiki/Brotli

A few highlights and important facts about Brotli you should be aware of include:

◾Brotli offers a comparable compression ratio offered by the best compression methods and uses less CPU. Additionally, it is considerably better than Gzip.
◾Both the server and browser must be Brotli compatible to take advantage of this compression method (more on browser and web server support below).
◾Browsers will not accept Brotli encoding over HTTP connections, only HTTPS.

Browser support:

Chrome since version 50,
Android Browser version 50,
Chrome for Android since version 50,
Firefox since version 44,
Firefox for Android since version 46,
Opera since version 38.

Is there an easy way to test what the compression level is? I have got mod_brotli running now on 2 Apache 2.4.25 instances on my dev server (VC11 x64 and VC14 x64) and on my laptop with Apache 2.4.25 VC9 x86. I would like two know the difference.

Drupal 7 compresses the css and js files to *.css.gz and *.js.gz and sends those to the client in stead of the requested *.css and *.js. In the standard Drupal 7 .htaccess it prevents that the server deflates or gzips those files for the second time.

However Drupal knows nothing of brotli compression with the result that the already gzipped *.css and *.js files became compressed twice and were unreadable by the browser.

When I saw the Drupal tricks, I took the safe road and made only certain file types subject to mod_brotli. For this I also had to enable mod_filter.so. Part of my httpd.conf now: