Skip to content

fix: refresh cached app shell on navigation - #3

Open
DorianChn wants to merge 1 commit into
mainfrom
codex/fix-service-worker-refresh
Open

DorianChn wants to merge 1 commit into
mainfrom
codex/fix-service-worker-refresh

Conversation

@DorianChn

Copy link
Copy Markdown
Owner

Summary

  • change the CodeCraft app shell navigation path from cache-first to network-first
  • refresh the offline index.html copy after a successful network response
  • keep cached static assets cache-first and preserve an offline shell fallback
  • add a focused Service Worker regression test and a small CI workflow

Why

The previous Service Worker always served a cached navigation when one existed. Because the cache name did not change with normal content releases, users could continue seeing an outdated index.html after deployment. This keeps offline behavior while allowing normal navigations to receive the current app shell.

Validation

  • node scripts/test_service_worker.mjs
  • node --check sw.js
  • node --check scripts/test_service_worker.mjs
  • git diff --check
  • high-risk secret pattern scan ✅
  • Python validation was not run because Python is not installed in the local environment

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant