sw-toolbox
sw-toolbox copied to clipboard
DOMException: Entry was not found using toolbox.cache
Sometimes, using repeatedly toolbox.cache(url) a get this exception in Chrome Canary: DOMException: Entry was not found.
At the first and second page views, all seems ok. From the third, I always get this exception trying to cache the same (large) list of files.
When are you calling toolbox.cache, and are you doing anything else at the same time?
One of the ways that I've heard this error can occur is if you exceed the size limit of the cache, but that only seems to fit your case if the resources have different URLs or if they get stored in a new cache. Otherwise it would be too big the first time around, too.
The other possibility is that you have a timing bug, where you have two async processes going on, one which deletes the cache and one which adds things to it. You trigger the delete to start fresh but accidentally don't wait for it to finish before adding things to the cache with the same name.
This also doesn't sound like your case though, I guess.
Do you have a small example of code that has this problem?
Hi, thanks for your support.
I am using the sw-toolbox for precaching and for caching a list of urls sent by the app via postMessage.
I don't thing it is a size limit error too. As you have pointed out, the urls and the files are the same when the error happens.
Maybe is something happening when the cache is moving from -inactive to the final name and a postMessage has been triggered?
Right now, the application structure is very complex, but I'll try to reproduce the error in a simple environment for sharing.