Skip to content

Commit

Permalink
Merge pull request #37010 from Nico264/bugfix-cache-control-immutable
Browse files Browse the repository at this point in the history
Fix Cache-Control header of non-versioned assets
  • Loading branch information
szaimen authored Mar 14, 2023
2 parents 1bf68d8 + 7aae6c1 commit 2b291e7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b291e7

Please sign in to comment.