From 021b9392416c7b295a15e36ae899ab060ddb1fef Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Fri, 17 Apr 2026 13:09:36 -0400 Subject: [PATCH] fix: send Clear-Site-Data on /__reset for full browser nuke MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit caches.delete() only clears service-worker managed caches — the browser's own HTTP cache can still serve stale or corrupted chunk responses. Setting Clear-Site-Data tells the browser itself to drop cookies, cached responses, storage, and service worker registrations for the origin, which is what's actually needed to unstick a PWA with a bad cached chunk. Co-Authored-By: Claude Opus 4.7 (1M context) --- search-app/server.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/search-app/server.js b/search-app/server.js index 3b0da82..9dd4f61 100644 --- a/search-app/server.js +++ b/search-app/server.js @@ -123,6 +123,10 @@ const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'no-store, no-cache, must-revalidate', + // Clear-Site-Data tells the browser itself to drop cookies, + // cached responses, local storage, and SW registrations for + // this origin — far more thorough than the JS-side caches.delete. + 'Clear-Site-Data': '"cache", "storage", "executionContexts"', 'Service-Worker-Allowed': '/' }); res.end(RESET_HTML);