fix: send Clear-Site-Data on /__reset for full browser nuke
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) <noreply@anthropic.com>
This commit is contained in:
parent
76f8816b82
commit
021b939241
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue