This recipe shows how to have the service worker immediately take control of the page without waiting for a navigation event.
Beginner
Basic service worker registration requires a navigation event to occur before the service worker starts working. This recipe illustrates a trick you can use for the service worker to immediately start working upon install.
- Register a service worker
- Delete old cache if present
- Immediately claim the service worker
General Usage