You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
If a user has too little space on their harddrive or runs chrome on a partition that is space constrained in other ways, then the serviceworker may start up, but then crash with a cryptic message in the error log:
IMHO, this is a clear bug. SW-toolbox should at least be able let the client run but with the files uncached. As it is, other sites work, but our site just hangs...
Here's my sw.js:
(global=>{'use strict'// PRECACHE// Load the sw-toolbox library.global.importScripts('/v3-files/assets/sw-toolbox.js')// Turn on debug logging, visible in the Developer Tools' console.global.toolbox.options.debug=false// Set up a handler for HTTP GET requests for /data/ URLs:global.toolbox.router.get(/https:\/\/(localhost|elev.asku.no|gt)(:3000|)\//,global.toolbox.networkFirst,{})global.toolbox.router.get(/https:\/\/(localhost|elev.asku.no|gt)(:3000|)\/centrifugo.+/,global.toolbox.networkFirst,{})global.toolbox.router.get(/https:\/\/(localhost|elev.asku.no|gt)(:3000|)\/v3-files\/assets.+/,global.toolbox.cacheFirst,{})global.toolbox.router.get(/https:\/\/(localhost|elev.asku.no|gt)(:3000|)\/v3-files\/js.+/,global.toolbox.networkFirst,{})global.toolbox.router.get(/https:\/\/(localhost|elev.asku.no|gt)(:3000|)(media|uploads)\/.+/,global.toolbox.cacheFirst,{})global.toolbox.router.get(/\/fonts.gstatic.com\/.+/,global.toolbox.cacheFirst,{})// By default, all requests that don't match our custom handler will use the// toolbox.networkFirst cache strategy, and their responses will be stored in// the default cache.// global.toolbox.router.default = global.toolbox.networkOnlyvarpreCacheFiles=[]global.toolbox.precache(preCacheFiles)// Boilerplate to ensure our service worker takes control of the page as soon// as possible.global.addEventListener('install',event=>event.waitUntil(global.skipWaiting()))global.addEventListener('activate',event=>event.waitUntil(global.clients.claim()))})(self)
If a user has too little space on their harddrive or runs chrome on a partition that is space constrained in other ways, then the serviceworker may start up, but then crash with a cryptic message in the error log:
IMHO, this is a clear bug. SW-toolbox should at least be able let the client run but with the files uncached. As it is, other sites work, but our site just hangs...
Here's my sw.js: