From 4498ff65ac1b90ad78037446dd8b1d3d9b729675 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 13:45:47 +0000 Subject: [PATCH 1/2] fix: robust cache busting on deployment - Express: index.html served with no-cache/no-store headers; /assets/ immutable 1y - Service worker: version-based cache purge on activate; CACHE_BUSTED message to clients - HTML: meta http-equiv Cache-Control/Pragma/Expires tags prevent proxy caching - Nginx: split /assets/ (immutable) from HTML (no-cache); sw.js/manifest.json dedicated rules - Client: SW update listener auto-reloads tabs when new version deploys Co-Authored-By: Patrick Munis --- client/index.html | 29 ++++++- client/public/sw.js | 132 ++++++++++++++++++++++-------- infra/nginx/conf.d/locations.conf | 32 +++++++- infra/nginx/nginx.conf | 38 ++++++++- server/_core/vite.ts | 27 +++++- 5 files changed, 217 insertions(+), 41 deletions(-) diff --git a/client/index.html b/client/index.html index 4038db4d6e..e17ced81c7 100644 --- a/client/index.html +++ b/client/index.html @@ -4,6 +4,10 @@ + + + + NDSEP — National Data Sovereignty Enforcement Platform @@ -49,11 +53,32 @@ - + diff --git a/client/public/sw.js b/client/public/sw.js index 494c2f3090..3accc6a1c4 100644 --- a/client/public/sw.js +++ b/client/public/sw.js @@ -1,20 +1,24 @@ /** - * NDSEP Service Worker — Offline-First PWA - * Stale-while-revalidate for static assets, network-first for API. + * NDSEP Service Worker — Offline-First PWA with Cache Busting + * + * Cache strategy: + * - CACHE_VERSION is bumped on every deploy (build injects a hash via Vite). + * - On activate, ALL caches whose name doesn't match the current version are + * deleted, guaranteeing stale JS/CSS from a prior deploy is never served. + * - Navigation requests (HTML) are always network-first so the latest + * index.html (with fresh