The service worker life cycle looks simple until you start working with service workers. Understanding how the life cycle executes is helpful so that you can understand what the state of your service worker is.
The service worker life cycle is designed to help us avoid situations where you upgrade and could potentially break the application. A new service worker can be registered, but wait for any existing clients to close. When safe, you could use the skipWaiting method to allow a new service worker to immediately take control.
More complex applications may also have multiple service workers with different scopes. This allows larger applications to silo control across the different sub applications.
Now that you have a foundation in how to use the service worker and the service worker life cycle, in the next chapter, you will see how to use the Fetch and Cache APIs to...