Skip to content

Commit 0b4cc1b

Browse files
authored
Merge pull request #37247 from nextcloud/backport/37010/stable26
[stable26] Fix Cache-Control header of non-versioned assets
2 parents 45ecf37 + 4bcb38c commit 0b4cc1b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.htaccess

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,12 @@
4141

4242
# Add cache control for static resources
4343
<FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)$">
44-
Header set Cache-Control "max-age=15778463"
45-
</FilesMatch>
46-
47-
<FilesMatch "\.(css|js|svg|gif|png|jpg|ico|wasm|tflite)(\?v=.*)?$">
48-
Header set Cache-Control "max-age=15778463, immutable"
44+
<If "%{QUERY_STRING} =~ /(^|&)v=/">
45+
Header set Cache-Control "max-age=15778463, immutable"
46+
</If>
47+
<Else>
48+
Header set Cache-Control "max-age=15778463"
49+
</Else>
4950
</FilesMatch>
5051

5152
# Let browsers cache WOFF files for a week

0 commit comments

Comments
 (0)