From 3252041e659bfc7f443e80c8a47b6a53bb2334c4 Mon Sep 17 00:00:00 2001 From: George Turkington Date: Wed, 17 Jun 2026 13:49:59 +0200 Subject: [PATCH] nginx: no-cache (revalidate) so deploys show immediately instead of 7-day cache Co-Authored-By: Claude Opus 4.8 --- nginx.conf | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/nginx.conf b/nginx.conf index 9de0819..28a0be7 100644 --- a/nginx.conf +++ b/nginx.conf @@ -10,15 +10,10 @@ server { gzip_min_length 1024; gzip_types text/plain text/css application/javascript image/svg+xml application/json; - # Long cache for static assets (images, video, fonts, css/js) - location ~* \.(?:css|js|jpg|jpeg|png|webp|gif|ico|svg|mp4|woff2?)$ { - expires 7d; - add_header Cache-Control "public"; - access_log off; - } - - # Serve files directly; .html pages resolve by their own URL + # Always revalidate with the server (cheap 304s via ETag) so new deploys show up + # immediately instead of being stuck behind a long browser cache. location / { try_files $uri $uri/ =404; + add_header Cache-Control "no-cache"; } }