From 42ce877cb8dc437af2cc03783f7ae2bb25e3b704 Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Tue, 27 May 2025 15:47:41 +0200 Subject: [PATCH] Add cache headers for console static assets Configure 1-day caching with revalidation for images, CSS, fonts, and icons in the /console path to improve performance while ensuring freshness. --- docker/nginx.conf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/nginx.conf b/docker/nginx.conf index 0aba86e84e..1f53fec8f1 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -4,7 +4,6 @@ server { gzip_static on; - # Set root for all locations root /usr/share/nginx/html; # Security headers for all locations @@ -22,11 +21,17 @@ server { add_header Cache-Control "public"; } + # Cache, but revalidate, for images, css, fonts, and icons folders + location ~* ^/console/(images|css|fonts|icons)/ { + expires 1d; + add_header Cache-Control "public, must-revalidate"; + } + # All other /console requests (no cache) location /console { index index.html index.html; try_files $uri /console/index.html; - + expires 0; add_header Cache-Control "no-store"; add_header Pragma "no-cache";