summaryrefslogtreecommitdiffstats
path: root/.htaccess
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-02-11 22:14:04 +0100
committerCarl Schwan <carl@carlschwan.eu>2022-02-18 14:28:24 +0100
commitf6d0bb419ede2acf2c7ef0e42d1647ff56bee085 (patch)
tree37eb2763d4e6eaba41f2e043b96c4e922466d3fb /.htaccess
parentcbc1cc78d1251028dab636ac40f558622d59941f (diff)
downloadnextcloud-server-f6d0bb419ede2acf2c7ef0e42d1647ff56bee085.tar.gz
nextcloud-server-f6d0bb419ede2acf2c7ef0e42d1647ff56bee085.zip
Improve caching policy
* Cache css with version in url. This makes most js and css requests to be cached by the browser * Force caching previews, the etag is in the url so that if the propfind gives a new etag, we will refresh it otherwise it's no use to try to fetch the new etag and do tons of DB queries Tested with firefox and 'debug' => false (important so that the js/css urls are generated with ?v= parameter) Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to '.htaccess')
-rw-r--r--.htaccess4
1 files changed, 4 insertions, 0 deletions
diff --git a/.htaccess b/.htaccess
index ce84f0698c7..60908984185 100644
--- a/.htaccess
+++ b/.htaccess
@@ -47,6 +47,10 @@
Header set Cache-Control "max-age=15778463"
</FilesMatch>
+ <FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)(\?v=.*)?$">
+ Header set Cache-Control "max-age=15778463, immutable"
+ </FilesMatch>
+
# Let browsers cache WOFF files for a week
<FilesMatch "\.woff2?$">
Header set Cache-Control "max-age=604800"