diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-02-11 22:14:04 +0100 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-02-18 14:29:36 +0100 |
commit | 1da8fe529fdb47c63e14215094ab5d1cf72d8383 (patch) | |
tree | 3b5eb09e4d022494c0d4e5efbf76ea414355d895 /.htaccess | |
parent | ef67f0118c461270bebd6c4f36caf37c8a1d335f (diff) | |
download | nextcloud-server-1da8fe529fdb47c63e14215094ab5d1cf72d8383.tar.gz nextcloud-server-1da8fe529fdb47c63e14215094ab5d1cf72d8383.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-- | .htaccess | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/.htaccess b/.htaccess index 4986f7d380f..ecb7046aab2 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" |