summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2023-03-14 13:11:52 +0100
committerGitHub <noreply@github.com>2023-03-14 13:11:52 +0100
commit2b291e74d55e9b1eb2111135d4ffb10c8308d462 (patch)
tree61d73fe36610be065651487330ff82003d9df2a8
parent1bf68d803734f51d3a9ed3ceb9130dccfa720905 (diff)
parent7aae6c12e51597bf8996b0fcdc3a64109733bce5 (diff)
downloadnextcloud-server-2b291e74d55e9b1eb2111135d4ffb10c8308d462.tar.gz
nextcloud-server-2b291e74d55e9b1eb2111135d4ffb10c8308d462.zip
Merge pull request #37010 from Nico264/bugfix-cache-control-immutable
Fix Cache-Control header of non-versioned assets
-rw-r--r--.htaccess11
1 files changed, 6 insertions, 5 deletions
diff --git a/.htaccess b/.htaccess
index dd0fce231e8..956e29ea7c4 100644
--- a/.htaccess
+++ b/.htaccess
@@ -41,11 +41,12 @@
# Add cache control for static resources
<FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)$">
- 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"
+ <If "%{QUERY_STRING} =~ /(^|&)v=/">
+ Header set Cache-Control "max-age=15778463, immutable"
+ </If>
+ <Else>
+ Header set Cache-Control "max-age=15778463"
+ </Else>
</FilesMatch>
# Let browsers cache WOFF files for a week