From 08b38aedc7586e6fecbeac717f1c49d3aa341d87 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Wed, 19 Jun 2024 13:26:21 +0200 Subject: [PATCH] Add caching headers for apache (#250) --- public/.htaccess | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/public/.htaccess b/public/.htaccess index bcce7fcc..26307f05 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -66,3 +66,62 @@ DirectoryIndex index.php # RedirectTemp cannot be used instead + + + ExpiresActive On + ExpiresByType image/gif "access plus 1 year" + ExpiresByType image/png "access plus 1 year" + ExpiresByType image/svg+xml "access plus 1 year" + ExpiresByType image/svg "access plus 1 year" + ExpiresByType image/jpeg "access plus 1 year" + ExpiresByType image/jpg "access plus 1 year" + ExpiresByType image/webp "access plus 1 year" + ExpiresByType image/x-icon "access plus 1 year" + ExpiresByType image/vnd.microsoft.icon "access plus 1 year" + ExpiresByType application/javascript "access plus 1 year" + ExpiresByType text/javascript "access plus 1 year" + ExpiresByType text/css "access plus 1 year" + ExpiresByType font/woff2 "access plus 1 year" + ExpiresByType font/woff "access plus 1 year" + ExpiresByType font/eot "access plus 1 year" + ExpiresByType font/ttf "access plus 1 year" + ExpiresByType video/mp4 "access plus 1 year" + + + + + Header set Cache-Control "public, max-age=31536000, immutable" + + + # recommended security headers + Header set X-Content-Type-Options "nosniff" + Header set X-Frame-Options "sameorigin" + Header set X-XSS-Protection "1; mode=block" + + + + AddOutputFilterByType DEFLATE text/html + AddOutputFilterByType DEFLATE application/atom+xml + AddOutputFilterByType DEFLATE application/javascript + AddOutputFilterByType DEFLATE application/json + AddOutputFilterByType DEFLATE application/rss+xml + AddOutputFilterByType DEFLATE application/vnd.ms-fontobject + AddOutputFilterByType DEFLATE application/x-font-opentype + AddOutputFilterByType DEFLATE application/x-font-truetype + AddOutputFilterByType DEFLATE application/x-font-ttf + AddOutputFilterByType DEFLATE application/x-javascript + AddOutputFilterByType DEFLATE application/xhtml+xml + AddOutputFilterByType DEFLATE application/xml + AddOutputFilterByType DEFLATE font/eot + AddOutputFilterByType DEFLATE font/opentype + AddOutputFilterByType DEFLATE font/otf + AddOutputFilterByType DEFLATE font/truetype + AddOutputFilterByType DEFLATE image/svg+xml + AddOutputFilterByType DEFLATE image/vnd.microsoft.icon + AddOutputFilterByType DEFLATE image/x-icon + AddOutputFilterByType DEFLATE image/x-win-bitmap + AddOutputFilterByType DEFLATE text/css + AddOutputFilterByType DEFLATE text/javascript + AddOutputFilterByType DEFLATE text/plain + AddOutputFilterByType DEFLATE text/xml +