]> Frank Brehm's Git Trees - pixelpark/hiera.git/commitdiff
spk-spar-checker add ExpiresByType
authorAndreas Gerstenberg <gerstenberg@pixelpark.com>
Fri, 10 Nov 2017 13:51:51 +0000 (14:51 +0100)
committerAndreas Gerstenberg <gerstenberg@pixelpark.com>
Fri, 10 Nov 2017 13:51:51 +0000 (14:51 +0100)
customer/spk-spar-checker/test.yaml

index a99d4deafab190318e781476423f5317361a3f35..1941168060d80f51fb0d846449e35a49d9751bd7 100644 (file)
@@ -104,13 +104,42 @@ infra::profile::apache::pp_vhosts:
         directoryindex: 'index.html'
         custom_fragment: |
           AddType text/plain .tmpl
+              ## Configuration of the cache expiration
+              # Images and Fonts are versioned and should be cached 1 year
+              # JS and CSS are versioned, but should only be cached for 1 month
+              # The rest should not be cached
               ExpiresActive On
-              ExpiresDefault A0
-              <FilesMatch "\.(html|tmpl|js)$">
-                ExpiresDefault A0
-                Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
-                Header set Pragma "no-cache"
-              </FilesMatch>
+              ExpiresDefault                              A2592000
+
+              # Versioned assets
+              ExpiresByType image/png                     A31536000
+              ExpiresByType image/gif                     A31536000
+              ExpiresByType image/jpeg                    A31536000
+              ExpiresByType image/svg+xml                 A31536000
+              ExpiresByType application/x-font-ttf        A31536000
+              ExpiresByType application/x-font-truetype   A31536000
+              ExpiresByType application/x-font-opentype   A31536000
+              ExpiresByType application/font-sfnt         A31536000
+              ExpiresByType application/vnd.ms-fontobject A31536000
+              ExpiresByType application/font-woff         A31536000
+              ExpiresByType application/font-woff2        A31536000
+
+              # Versioned code
+              ExpiresByType text/css                      A2592000
+              ExpiresByType application/javascript        A2592000
+
+              # Not versioned assets
+              ExpiresByType application/manifest+json           A0
+              ExpiresByType text/plain                          A0
+              ExpiresByType text/html                           A0
+              ExpiresByType application/x-web-app-manifest+json A0
+              ExpiresByType text/cache-manifest                 A0
+              ExpiresByType application/json                    A0
+              ExpiresByType application/ld+json                 A0
+              ExpiresByType application/schema+json             A0
+              ExpiresByType application/vnd.geo+json            A0
+              ExpiresByType text/javascript                     A0
+              ExpiresByType text/xml                            A0
 
         rewrites:
           - comment: 'frontend root rewrite'