nginx: no-cache (revalidate) so deploys show immediately instead of 7-day cache

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 13:49:59 +02:00
parent 8e6f3fc49a
commit 3252041e65
+3 -8
View File
@@ -10,15 +10,10 @@ server {
gzip_min_length 1024; gzip_min_length 1024;
gzip_types text/plain text/css application/javascript image/svg+xml application/json; gzip_types text/plain text/css application/javascript image/svg+xml application/json;
# Long cache for static assets (images, video, fonts, css/js) # Always revalidate with the server (cheap 304s via ETag) so new deploys show up
location ~* \.(?:css|js|jpg|jpeg|png|webp|gif|ico|svg|mp4|woff2?)$ { # immediately instead of being stuck behind a long browser cache.
expires 7d;
add_header Cache-Control "public";
access_log off;
}
# Serve files directly; .html pages resolve by their own URL
location / { location / {
try_files $uri $uri/ =404; try_files $uri $uri/ =404;
add_header Cache-Control "no-cache";
} }
} }