4 ms·
Maybe I'm confused, but provided I bootstrap the app every time by downloading a script that then downloads the big-ass app (that includes styling and whatnot)
by mercer 9y ago
Maybe I'm confused, but provided I bootstrap the app every time by downloading a script that then downloads the big-ass app (that includes styling and whatnot) if necessary, I should be fine right? Or am I missing something?
That said I do understand that avoiding this could be desirable.
- pfooti 9y agoWhat happens if your user is offline (airplane mode, no data, etc), and can't download the initial bootstrap script? There's no way to avoid an error page at this time, unless you use a browser-specific plugin (the drive offline addon is one of these, but they now use service workers for the same functionality on chrome IIRC). This is especially useful in non-us, non-eu countries, where people pay a lot for data, relative to their income. Being able to successfully launch and run without any data usage is pretty rad.
- mercer 9y agoAh, of course. That is indeed a significant issue...
- MuppetMaster42 9y agoService workers are in a separate layer to your app code. They're in another thread, they're subject to different memory/storage rules, they have access to a few extra apis IIRC. Service workers are designed to be run independently of your web page. I.e. Your service worker can run in the background and update your apps resource files (or even cached xhr data) when your website isn't open, so that it's ready when the user accesses your site. This means your site goes from remotely delivered to locally served. Which reduces the load times to super low. IMO it's also nice and clean because it lets you completely separate your app and network logic. Your web app itself can be built as if it is always online, and all the offline logic is in the separate code package in a separate thread.