]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(htaccess): Serve images as static assets 46543/head
authorFerdinand Thiessen <opensource@fthiessen.de>
Mon, 15 Jul 2024 16:06:13 +0000 (18:06 +0200)
committerFerdinand Thiessen <opensource@fthiessen.de>
Mon, 15 Jul 2024 16:06:13 +0000 (18:06 +0200)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
.htaccess
lib/private/Setup.php

index f6474c8dbca6a9e3b55a95b28a3c436cec86f7b9..76573880c0b87934a1d05a23baf430fe42483c68 100644 (file)
--- a/.htaccess
+++ b/.htaccess
@@ -40,7 +40,7 @@
   </IfModule>
 
   # Add cache control for static resources
-  <FilesMatch "\.(css|js|mjs|svg|gif|png|jpg|ico|wasm|tflite)$">
+  <FilesMatch "\.(css|js|mjs|svg|gif|png|jpg|webp|ico|wasm|tflite)$">
     <If "%{QUERY_STRING} =~ /(^|&)v=/">
       Header set Cache-Control "max-age=15778463, immutable"
     </If>
index a568365544746984befcd6ca4ce49d177bb0ef1c..a67d74bd032ee2916eea158318e84eb1e9e4c449 100644 (file)
@@ -481,7 +481,7 @@ class Setup {
                        $content .= "\n  Options -MultiViews";
                        $content .= "\n  RewriteRule ^core/js/oc.js$ index.php [PT,E=PATH_INFO:$1]";
                        $content .= "\n  RewriteRule ^core/preview.png$ index.php [PT,E=PATH_INFO:$1]";
-                       $content .= "\n  RewriteCond %{REQUEST_FILENAME} !\\.(css|js|mjs|svg|gif|png|html|ttf|woff2?|ico|jpg|jpeg|map|webm|mp4|mp3|ogg|wav|flac|wasm|tflite)$";
+                       $content .= "\n  RewriteCond %{REQUEST_FILENAME} !\\.(css|js|mjs|svg|gif|ico|jpg|jpeg|png|webp|html|ttf|woff2?|map|webm|mp4|mp3|ogg|wav|flac|wasm|tflite)$";
                        $content .= "\n  RewriteCond %{REQUEST_FILENAME} !/core/ajax/update\\.php";
                        $content .= "\n  RewriteCond %{REQUEST_FILENAME} !/core/img/(favicon\\.ico|manifest\\.json)$";
                        $content .= "\n  RewriteCond %{REQUEST_FILENAME} !/(cron|public|remote|status)\\.php";