|
|
|
|
|
by MuppetMaster42
3296 days ago
|
|
Service 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. |
|