LiveSplitOne icon indicating copy to clipboard operation
LiveSplitOne copied to clipboard

Await the service worker

Open CryZe opened this issue 6 years ago • 2 comments

At the moment we are setting up the service worker and in the meantime already await the imports. The problem with this is that the service worker will have to download everything as well, so on a completely clean set up, you are downloading everything twice at the moment.

CryZe avatar Feb 21 '20 19:02 CryZe

I'm not sure how we can actually do this. The promise returned by navigator.serviceWorker.register seems to resolve before all the actual file caching happens.

wooferzfg avatar Feb 22 '20 16:02 wooferzfg

I believe part of the problem here could be that locally we request a different URL than the service worker does (the service worker includes some hash in the URL), so the normal browser cache considers it a cache miss and does another request. I'm pretty sure we can easily change the configuration of our service worker to not do that, if that is indeed the problem.

CryZe avatar Mar 09 '20 16:03 CryZe