fipamo/themes/tim-duncan.js

36 lines
674 B
JavaScript

importScripts('./workbox-sw.js');
if (workbox) {
//console.log(`Yay! Workbox is loaded 🎉`);
} else {
//console.log(`Boo! Workbox didn't load 😬`);
}
workbox.routing.registerRoute(
new RegExp('.*\.js'),
workbox.strategies.networkFirst({
cacheName: 'script'
})
);
workbox.routing.registerRoute(
new RegExp('.*\.css'),
workbox.strategies.networkFirst({
cacheName: 'style'
})
);
workbox.routing.registerRoute(
new RegExp('.*\.(?:png|jpg|jpeg|svg|gif)'),
workbox.strategies.networkFirst({
cacheName: 'images'
})
);
workbox.routing.registerRoute(
new RegExp('/@/dashboard'),
workbox.strategies.networkFirst({
cacheName: 'pages'
}));