Answer
How do you update a PWA’s service worker?
Browsers automatically check your service-worker script for byte-level changes on every navigation (and roughly every 24 hours in the background). If it differs, the new version installs and waits until old tabs close before activating. Calling self.skipWaiting() in install and clients.claim() in activate makes the new version take over immediately instead of waiting.
Default (safe) update
Without skipWaiting(), users on an old tab keep using the old worker until they close every tab for that origin, avoiding a version mismatch mid-session.
Forced immediate update
skipWaiting() plus clients.claim() activates the new worker on next reload — commonly paired with a "New version available, refresh" toast so users are not surprised.
Cache versioning
Name your caches with a version string (e.g. app-v3) and delete old-versioned caches in the activate event so users are not stuck with stale assets.