mirror of
https://github.com/koel/koel
synced 2024-11-14 08:27:13 +00:00
21 lines
520 B
JavaScript
21 lines
520 B
JavaScript
importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.0.0/workbox-sw.js')
|
|
|
|
workbox.setConfig({ debug: false })
|
|
|
|
workbox.routing.registerRoute(
|
|
new RegExp('.*\.js'),
|
|
new workbox.strategies.NetworkFirst()
|
|
)
|
|
|
|
workbox.routing.registerRoute(
|
|
/\.(?:png|jpg|jpeg|svg|gif|eot|ttf|woff2?|otf)$/,
|
|
new workbox.strategies.CacheFirst({
|
|
cacheName: 'image-font-cache',
|
|
plugins: [
|
|
new workbox.expiration.Plugin({
|
|
maxEntries: 20,
|
|
maxAgeSeconds: 7 * 24 * 60 * 60
|
|
})
|
|
]
|
|
})
|
|
)
|