From: Tom Hughes Date: Tue, 18 Jun 2019 07:46:35 +0000 (+0100) Subject: Use the precompressed assets instead of compressing on the fly X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/8490395fe10856053dba05774cda6c2ffe52aa6e Use the precompressed assets instead of compressing on the fly --- diff --git a/cookbooks/web/templates/default/apache.frontend.erb b/cookbooks/web/templates/default/apache.frontend.erb index 45683bde2..5944e5f18 100644 --- a/cookbooks/web/templates/default/apache.frontend.erb +++ b/cookbooks/web/templates/default/apache.frontend.erb @@ -287,6 +287,19 @@ /rails/public> Require all granted + + RewriteCond "%{HTTP:Accept-encoding}" "gzip" + RewriteCond "%{REQUEST_FILENAME}\.gz" -s + RewriteRule "^(.*)\.(css|js|svg)" "$1\.$2\.gz" [QSA] + + RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1] + RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1] + RewriteRule "\.svg\.gz$" "-" [T=image/svg+xml,E=no-gzip:1] + + + Header append Content-Encoding gzip + Header append Vary Accept-Encoding +