From 52e243f4d81d997fa3493f608c83c75fa36d8f5f Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Mon, 15 Jul 2024 18:06:13 +0200 Subject: [PATCH] fix(htaccess): Serve images as static assets Signed-off-by: Ferdinand Thiessen --- .htaccess | 2 +- lib/private/Setup.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index f6474c8dbca6a..76573880c0b87 100644 --- a/.htaccess +++ b/.htaccess @@ -40,7 +40,7 @@ # Add cache control for static resources - + Header set Cache-Control "max-age=15778463, immutable" diff --git a/lib/private/Setup.php b/lib/private/Setup.php index a568365544746..a67d74bd032ee 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -481,7 +481,7 @@ public static function updateHtaccess(): bool { $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";