From: Tom Hughes Date: Sun, 13 Sep 2015 10:39:48 +0000 (+0100) Subject: Enable gzip compression of SVG assets X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/48217a85b90d2c4b3378b65206b6c5e2686c2a94 Enable gzip compression of SVG assets --- diff --git a/cookbooks/dev/recipes/default.rb b/cookbooks/dev/recipes/default.rb index 2e51fa546..014d9fafd 100644 --- a/cookbooks/dev/recipes/default.rb +++ b/cookbooks/dev/recipes/default.rb @@ -59,6 +59,7 @@ nodejs_package "svgo" easy_install_package "geojson" apache_module "env" +apache_module "deflate" apache_module "expires" apache_module "proxy" apache_module "proxy_fcgi" diff --git a/cookbooks/dev/templates/default/apache.apis.erb b/cookbooks/dev/templates/default/apache.apis.erb index 1afec5c93..3a7a58688 100644 --- a/cookbooks/dev/templates/default/apache.apis.erb +++ b/cookbooks/dev/templates/default/apache.apis.erb @@ -8,6 +8,8 @@ CustomLog /var/log/apache2/apis.dev.openstreetmap.org-access.log combined ErrorLog /var/log/apache2/apis.dev.openstreetmap.org-error.log + + AddOutputFilterByType DEFLATE image/svg+xml diff --git a/cookbooks/web/templates/default/apache.frontend.erb b/cookbooks/web/templates/default/apache.frontend.erb index 5c149872e..aa2aa1d98 100644 --- a/cookbooks/web/templates/default/apache.frontend.erb +++ b/cookbooks/web/templates/default/apache.frontend.erb @@ -30,6 +30,11 @@ ExpiresActive On RewriteEngine on + # + # Configure on the fly compression + # + AddOutputFilterByType DEFLATE image/svg+xml + # # Add the unique ID to the request headers #