 What if I told you that Google's engineers would write your service worker for you? I'm Sarah Clark and while I don't have a posse of engineers ready to serve your every whim, I have something almost as good. It's called Workbox. By now you've written your own service worker. It has a list of files to cache, but what happens if you add a file? What happens if you update a file? It may not be easy to update your service worker by hand. Also, what if you don't want to serve everything from the cache? If your content is time-sensitive, you might want to check the network first. You might want different strategies for network files versus user data. It can become rather complicated and Workbox can help. Workbox is a tool written and used by Google engineers that generate service worker code. Once you configure it, it locates the files on disk and builds a list of files to cache. It detects file changes and updates caches automatically. It supports multiple caches. It provides multiple access strategies so you can do the appropriate thing for each file. Workbox integrates into your build system, so the service worker is always up to date. To give you a quick idea of how this works, you add a service worker template to your source directory. The Workbox build tool adds code to this file and writes it in an output folder. You can control this with any build tool or the command line. The service worker you write may be as short as two lines or contain as much custom logic as you need, but you won't have to write the cache maintenance parts. Workbox starts with a template you supply. Let's take a look inside one. First, we call import scripts to load the Workbox library. You can host this on your own site or get it from the Google CDN. This will be cached for you. Now, add the pre-cache and route line with an empty array. Workbox will modify this line when it generates your service worker. If you need any other custom code, it goes at the end. Let's walk through an example of installing Workbox and creating a service worker. We'll do this from the command line. We'll need to install node, then use npm to install the Workbox-cli tool. Then we call the Workbox wizard to create a configuration file. We tell the wizard where our build directory lives and the files we want to cache. We then give locations for the service worker template and configuration file. By default, the wizard's code precaches everything forever. You may want a little more control, such as limiting the number of cached images. If so, you can add a cache rule and a custom cache name. Now we just run the Workbox tool to generate our service worker. That's all. You can register the service worker as usual. Note that we're assuming that everything is being copied into the build directory. The service worker is, as usual, at the root of the site. There's quite a bit more to Workbox, including the different access modes and cache options. There's also the integration with build systems. But for now, go to the Workbox site and try the getting started section to run this from the command line. In the next episodes, we'll look at Workbox in more depth, including how to connect it to your build system. Until then, have fun checking out Workbox.