Apache prefers to brotli over gzip when possible

Brotli is a better (than gzip) compression algorithm derived by Google.
It's available in Apache 2.4.26 and later.

https://en.wikipedia.org/wiki/Brotli
https://httpd.apache.org/docs/2.4/mod/mod_brotli.html

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
pull/6822/head
Jack Cherng 5 years ago
parent 26fd266496
commit 28b34d8198
No known key found for this signature in database
GPG Key ID: 5E7917F4ADC2AD36

@ -19,6 +19,13 @@ RewriteRule /?(README.*|meta\.json|composer\..*|jsdeps.json)$ - [F]
SetOutputFilter DEFLATE
</IfModule>
# prefer to brotli over gzip if brotli is available
<IfModule mod_brotli.c>
SetOutputFilter BROTLI_COMPRESS
# some assets have been compressed, so no need to do it again
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|web[pm]|woff2?)$ no-brotli
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"

Loading…
Cancel
Save