Workbox Route registration issue due to default route

bensladden
10
bensladden
commented 3 months ago

From what i can tell from the documentation the order of routing is based on the route that is registered first. (https://developers.google.com/web/tools/workbox/modules/workbox-routing)

What is the best way to cache an api call (i.e. /api/somthing/.) if this registration is blocked via the default networkFirst strategy implemented? (workbox.routing.registerRoute(new RegExp('/.'), workbox.strategies.networkFirst({}), 'GET'))

Use-case: in my app i have a series of calls that get historical data between ranges. These ranges are passed as parameters and can change however it would be good to cache these (taking the associated parameters into account) in the event of re-request of the same data.

I would perfer the workbox to handle this for me rather then writing js to catch these events.

0
bensladden
10
bensladden
commented 3 months ago

Go around issue by creating a plugin and inserting it in caching extensions

0
Informations
Question โ€ข Resolved
#c168 - Created 3 months ago