Cache the shared app shell HTML

This commit is contained in:
scamiv
2026-03-22 21:00:11 +01:00
parent 0635daa742
commit fd19295fea
9 changed files with 138 additions and 23 deletions
+5 -9
View File
@@ -304,18 +304,14 @@ server {
}
# Root location with short Nginx cache but no browser cache
# Root location with short shared cache for the app shell
location = / {
proxy_pass http://127.0.0.1:3000;
# Tell browsers not to cache
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
# But let Nginx cache for 1 second to reduce load
# Cache the shared app shell briefly at the proxy; browser/CDN policy
# comes from the upstream Cache-Control header.
proxy_cache STATIC;
proxy_cache_valid 200 302 1s;
proxy_cache_valid 200 302 300s;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;