Closed jegj closed 7 years ago
It's probably easiest to implement that logic inside your own standalone script, and then pass the path to that script in to the importScripts
option when you build your service worker.
Alternatively, you can explore using the new Workbox project, which uses a model in which it's easier for you to add code to your top-level service worker file, including putting in custom runtime routing logic: https://workboxjs.org/examples/workbox-sw/
I would like to implement my own logic on a custom handler on the runtimeCaching option. Intercept an ajax request and respond using data on IndexDB or send the request to the network and update my indexDB data. is that posible?