If you are a regular visitor to a certain website, chances are that you may be loading most of the resources such as CSS and JavaScript files from your cache rather than the server itself. This saves us necessary bandwidth for the server as well as requests over the network. Having control over which content we deliver from the cache and server is a great advantage. The server worker provides us this powerful feature by giving us programmatic control over the content. In this recipe, we are going to look at the methods that enable us to do so by creating a performance art event viewer web app.
To get started with service workers, you will need to have the service worker experiment feature turned on in your browser settings. If you have not done this yet, refer to the Setting up service workers recipe of Chapter 1, Learning Service Worker Basics. Service workers only run across HTTPS. To find out how to set up a development environment...