From eefd3a59342ff88ce37cbf4c82a0ea1d3318bebd Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 18 Jun 2019 12:02:22 +0100 Subject: [PATCH] Serve precompressed JSON resources --- cookbooks/web/templates/default/apache.frontend.erb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cookbooks/web/templates/default/apache.frontend.erb b/cookbooks/web/templates/default/apache.frontend.erb index 5197ebbc7..4030eda4f 100644 --- a/cookbooks/web/templates/default/apache.frontend.erb +++ b/cookbooks/web/templates/default/apache.frontend.erb @@ -291,13 +291,14 @@ RewriteCond "%{HTTP:Accept-encoding}" "gzip" RewriteCond "%{REQUEST_FILENAME}\.gz" -s - RewriteRule "^(.*)\.(css|js|svg)$" "$1\.$2\.gz" [QSA] + RewriteRule "^(.*)\.(css|js|json|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 "\.json\.gz$" "-" [T=application/json,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 -- 2.39.5