From f111cbb2a4d5af54d507b4c7d9a25bac179775de Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 9 Dec 2025 18:29:24 +0100 Subject: [PATCH] :sparkles: Add better cache config on devenv nginx --- docker/devenv/files/nginx.conf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docker/devenv/files/nginx.conf b/docker/devenv/files/nginx.conf index 6af0fef033..5e8e408ccb 100644 --- a/docker/devenv/files/nginx.conf +++ b/docker/devenv/files/nginx.conf @@ -223,16 +223,19 @@ http { add_header X-Cache-Status $upstream_cache_status; } - location ~ ^/(/|css|fonts|images|js|wasm|mjs|map) { + location ~* \.(jpg|png|svg|ttf|woff|woff2)$ { + add_header Cache-Control "public, max-age=604800" always; # 7 days + } + + location ~* \.(js|css|wasm)$ { + add_header Cache-Control "no-store" always; } location ~ ^/[^/]+/(.*)$ { return 301 " /404"; } - add_header Cache-Control "no-store"; - # This header is what we need to use on prod - # add_header Cache-Control "public, must-revalidate, max-age=0"; + add_header Cache-Control "no-store" always; try_files $uri /index.html$is_args$args /index.html =404; } }