GoogleChromeLabs / sw-toolbox

[Deprecated] A collection of service worker tools for offlining runtime requests
https://developers.google.com/web/tools/workbox/guides/migrations/migrate-from-sw
Apache License 2.0
3.62k stars 331 forks source link

Question: route priority #247

Open wilfrem opened 7 years ago

wilfrem commented 7 years ago

I have a question about routing.

I want to change cache strategy between js files, css files, and other.

// js files match this route
self.toolbox.router.get("/:path+.js", self.toolbox.networkFirst);
// all files except js files match this route 
self.toolbox.router.get("/:path+.(.*)", self.toolbox.networkOnly);
// no match this route. css files does not match this route
self.toolbox.router.get("/:path+.css", self.toolbox.cacheFirst);

Is it by design? What is the specification of route priority?