From d789586fcaa9ba8022426892ab44003cb5c4cd62 Mon Sep 17 00:00:00 2001 From: kcar Date: Thu, 21 May 2026 17:54:49 +0000 Subject: [PATCH] fix: nginx serves index.html with no-cache headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vite hashes all JS/CSS assets, so those can be cached for 30 days. But index.html must never be cached — it references the current hashes. Caching index.html meant users ran old JS after deploys. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e323d01..9ce9727 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,10 @@ RUN echo 'server { \ listen 3000; \ root /usr/share/nginx/html; \ index index.html; \ + location = /index.html { \ + expires -1; \ + add_header Cache-Control "no-store, no-cache, must-revalidate"; \ + } \ location / { \ try_files $uri $uri/ /index.html; \ expires 30d; \ @@ -44,4 +48,4 @@ RUN chown -R nginx:nginx /usr/share/nginx/html \ && chown -R nginx:nginx /var/log/nginx # Expose HTTP port (NPM will handle HTTPS) -EXPOSE 3000 \ No newline at end of file +EXPOSE 3000