So far, we have looked at dedicated and shared workers, which help throw computationally expensive tasks into the background. We have even created a shared cache that utilizes SharedWorker. Now, we will take a look at service workers and learn how they can be used to cache both resources (such as HTML, CSS, JavaScript, and so on) and data for us so that we don't have to make expensive round trips to our server.
In this chapter, we will cover the following topics:
- Understanding the ServiceWorker
- Caching pages and templates for offline use
- Saving requests for later
By the end of this chapter, we will be able to create offline experiences for our web applications.