workbox-sw is a high-level wrapper that ties together the smaller modules into a single, consistent interface.
For most developers,
be all your service worker needs to handle routing and caching.
workbox-sw handles both precaching (using a manifest generated by
workbox-build), and runtime
The example service worker for this page precaches a single file, and then sets up a number of runtime caching routes that will match requests made against various https://httpbin.org/ endpoints and for local files.
You can see the effect of the service worker by trying out the following:
to see how precached assets are served.
to see a RegExp route in action.
to demonstrate that requests which aren't matched by a route default to going against the network.
to see how a network-first strategey can have a maximum timeout, after which a previously cached response is used.
demonstrates cache expiration by fetching one of three sequential images, when the maximum cache size is two.