]> git.openstreetmap.org Git - chef.git/commitdiff
stateofthemap: add reasonable expiry headers
authorGrant Slater <git@firefishy.com>
Sun, 8 Dec 2019 20:26:03 +0000 (20:26 +0000)
committerGrant Slater <git@firefishy.com>
Sun, 8 Dec 2019 20:26:03 +0000 (20:26 +0000)
cookbooks/stateofthemap/recipes/default.rb
cookbooks/stateofthemap/templates/default/apache.erb
cookbooks/stateofthemap/templates/default/apache.jekyll.erb
cookbooks/stateofthemap/templates/default/apache.static.erb

index 162c1002f68c8f39c31a5a0832dfa1571909b2da..01c4bc91000d84b27ef6d4eb4d9b6e702522df00 100644 (file)
@@ -287,6 +287,9 @@ package %w[
   zlib1g-dev
 ]
 
+apache_module "expires"
+apache_module "rewrite"
+
 gem_package "bundler" do
   version "1.17.3"
 end
index 7cea946c43929f2615c061ec1afd45b1a1f10326..7cca3c5a1341bcd5b3344a55ecb99c5e26b762a0 100644 (file)
         SSLCertificateKeyFile /etc/ssl/private/stateofthemap.org.key
 
         DocumentRoot /srv/stateofthemap.org/html
+
+        ErrorDocument 404 /404.html
+
+        ExpiresActive On
+        ExpiresDefault "access plus 12 hours"
 </VirtualHost>
 
 <Directory /srv/stateofthemap.org/html>
index 005996b11983c05e40c26bb6d35b8721f806b0cc..504003df60a9bbe221d8f8c97bc197db7bf4f720 100644 (file)
         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"
 </VirtualHost>
 
 <Directory /srv/<%= @year %>.stateofthemap.org/_site>
index db543bb62a7a925f8c5894ee871d8073e80cf187..07ec18cbe2dc4a343e11e09c241ec07cdeb020d8 100644 (file)
         SSLCertificateKeyFile /etc/ssl/private/<%= @year %>.stateofthemap.org.key
 
         DocumentRoot /srv/<%= @year %>.stateofthemap.org
+
+        ErrorDocument 404 /404.html
+
+        ExpiresActive On
+        ExpiresDefault "access plus 7 days"
 </VirtualHost>
 
 <Directory /srv/<%= @year %>.stateofthemap.org>