a new API that allows you to run a script in background of your application and facilitates creating
Progressive Web Apps
First things first:
1. Unregister any pre-existing service workers
2. Clear any cache storages you've created in the past
1. Registration: browser is aware that we have a service worker that needs to be recognized, and will kick off the installation step upon a successful registration
2. Installation: the service worker is installed, but doesn’t actually control anything on the page just yet. This is a good phase to cache assets for offline use.
3. Activation: the service worker has been installed and is activated. This is a good place for us to manage old cached assets and update the service worker.
4. Full Page Control: the service worker has been activated and now has full control over any pages that fall under its scope