From: Grant Slater Date: Sun, 8 Dec 2019 20:26:03 +0000 (+0000) Subject: stateofthemap: add reasonable expiry headers X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/ee909b2bca278e9220f168783ffd5eb24727da24?hp=57ad18f5ccb73f3285674f8b971036724d4dc73f stateofthemap: add reasonable expiry headers --- diff --git a/cookbooks/stateofthemap/recipes/default.rb b/cookbooks/stateofthemap/recipes/default.rb index 162c1002f..01c4bc910 100644 --- a/cookbooks/stateofthemap/recipes/default.rb +++ b/cookbooks/stateofthemap/recipes/default.rb @@ -287,6 +287,9 @@ package %w[ zlib1g-dev ] +apache_module "expires" +apache_module "rewrite" + gem_package "bundler" do version "1.17.3" end diff --git a/cookbooks/stateofthemap/templates/default/apache.erb b/cookbooks/stateofthemap/templates/default/apache.erb index 7cea946c4..7cca3c5a1 100644 --- a/cookbooks/stateofthemap/templates/default/apache.erb +++ b/cookbooks/stateofthemap/templates/default/apache.erb @@ -46,6 +46,11 @@ SSLCertificateKeyFile /etc/ssl/private/stateofthemap.org.key DocumentRoot /srv/stateofthemap.org/html + + ErrorDocument 404 /404.html + + ExpiresActive On + ExpiresDefault "access plus 12 hours" diff --git a/cookbooks/stateofthemap/templates/default/apache.jekyll.erb b/cookbooks/stateofthemap/templates/default/apache.jekyll.erb index 005996b11..504003df6 100644 --- a/cookbooks/stateofthemap/templates/default/apache.jekyll.erb +++ b/cookbooks/stateofthemap/templates/default/apache.jekyll.erb @@ -39,6 +39,11 @@ SSLCertificateKeyFile /etc/ssl/private/<%= @year %>.stateofthemap.org.key DocumentRoot /srv/<%= @year %>.stateofthemap.org/_site + + ErrorDocument 404 /404.html + + ExpiresActive On + ExpiresDefault "access plus 10 minutes" .stateofthemap.org/_site> diff --git a/cookbooks/stateofthemap/templates/default/apache.static.erb b/cookbooks/stateofthemap/templates/default/apache.static.erb index db543bb62..07ec18cbe 100644 --- a/cookbooks/stateofthemap/templates/default/apache.static.erb +++ b/cookbooks/stateofthemap/templates/default/apache.static.erb @@ -39,6 +39,11 @@ SSLCertificateKeyFile /etc/ssl/private/<%= @year %>.stateofthemap.org.key DocumentRoot /srv/<%= @year %>.stateofthemap.org + + ErrorDocument 404 /404.html + + ExpiresActive On + ExpiresDefault "access plus 7 days" .stateofthemap.org>