Add better cache config on devenv nginx

This commit is contained in:
Andrey Antukh
2025-12-09 18:29:24 +01:00
parent dde0fddd6f
commit adaa869c31

View File

@@ -223,15 +223,20 @@ http {
add_header X-Cache-Status $upstream_cache_status; add_header X-Cache-Status $upstream_cache_status;
} }
location ~* \.(js|css|jpg|png|svg|ttf|woff|woff2|wasm)$ { location ~* \.(jpg|png|svg|ttf|woff|woff2)$ {
add_header Cache-Control "public, max-age=604800" always; # 7 days add_header Cache-Control "public, max-age=604800" always; # 7 days
} }
location ~* \.(js|css|wasm)$ {
# This only makes sense on PROD
# add_header Cache-Control "public, max-age=604800" always; # 7 days
}
location ~ ^/[^/]+/(.*)$ { location ~ ^/[^/]+/(.*)$ {
return 301 " /404"; return 301 " /404";
} }
add_header Cache-Control "no-store, no-cache, max-age=0" always; add_header Cache-Control "no-store" always;
try_files $uri /index.html$is_args$args /index.html =404; try_files $uri /index.html$is_args$args /index.html =404;
} }
} }