Emergency: self-destruct service worker to clear broken cache#30
Merged
Conversation
The SW from v3.0.0 pre-cached the broken HTML (app.js in wrong position). Even after PR #29 fixed the script order, any browser that visited during the broken window has stale content in its SW cache, preventing the site from loading. Fix: replace sw.js with a self-destructing stub that: 1. Immediately activates (skipWaiting) 2. Deletes ALL caches 3. Unregisters itself On next visit, the browser fetches the new sw.js (byte-differs from the old one), installs it, the activate handler wipes caches and unregisters. Subsequent loads go straight to the network with no SW interference. We can re-introduce a proper SW later with more careful cache invalidation. For now, getting the site loading is priority. Version meta bumped to 3.0.2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emergency fix — site not loading
The service worker from PR #28 (v3.0.0) pre-cached the broken HTML where
app.jsloaded after Alpine. Even though PR #29 fixed the script order, any browser that visited during the broken window has stale cached content served by the SW, preventing the site from loading.Fix
Replace
sw.jswith a self-destructing stub that:skipWaiting)On next visit, the browser detects the new
sw.js(byte-differs from old), installs it, the activate handler wipes caches and unregisters. All subsequent loads go straight to the network — no SW interference.We can reintroduce a proper service worker later with safer cache invalidation. Getting the site loading is priority.
Test plan
Generated by Claude Code