July 2018
Intermediate to advanced
354 pages
8h 51m
English
Up to this point, the Workbox section has focused on scaffolding, pre-caching, and configuration concerns. But as you should know by this point, the complexity of a service worker grows, managing dynamic requests or any request that does not have a pre-cached response.
This is where Workbox really flexes its muscles.
Dynamic routes, like the PWA tickets event pages, need to have custom caching logic applied to them. This is where the workbox.routing object comes into play. For each dynamic route, you need to register what the route is and a handler using the registerRoute method. Its signature looks like this:
workbox.routing.registerRoute(matchCb, handlerCb);
The method requires a match and handler callback method. ...
Read now
Unlock full access