mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 22:33:24 +00:00
sw
This commit is contained in:
20
src/sw.js
20
src/sw.js
@@ -16,24 +16,7 @@ if (workbox) {
|
||||
]
|
||||
})
|
||||
);
|
||||
workbox.routing.registerRoute(
|
||||
/\.(?:png|gif|jpg|jpeg|svg)$/,
|
||||
workbox.strategies.cacheFirst({
|
||||
cacheName: 'images',
|
||||
plugins: [
|
||||
new workbox.expiration.Plugin({
|
||||
maxEntries: 60,
|
||||
maxAgeSeconds: 30 * 24 * 60 * 60 // 30 Days
|
||||
})
|
||||
]
|
||||
})
|
||||
);
|
||||
workbox.routing.registerRoute(
|
||||
/\.(?:js|css)$/,
|
||||
workbox.strategies.staleWhileRevalidate({
|
||||
cacheName: 'static-resources'
|
||||
})
|
||||
);
|
||||
|
||||
try {
|
||||
workbox.googleAnalytics.initialize();
|
||||
} catch (e) {
|
||||
@@ -43,7 +26,6 @@ if (workbox) {
|
||||
console.log('Boo! Workbox didn\'t load 😬');
|
||||
}
|
||||
|
||||
|
||||
self.addEventListener('message', event => {
|
||||
if (!event.data) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user