|
|
|
|
|
by Kiro
2961 days ago
|
|
Stupid question but what does the Service Worker actually do? I thought they were used for offloading work to another thread but nowadays I always see it used for "offline mode". Why can't you just solve it with caching? Feels like I misunderstand something. |
|
Web Workers are used to offload work to another thread and can communicate with messages
Service Workers is a new API which is now supported by all major browsers.
SW is branded as: Rich offline experiences, periodic background syncs, push notifications and more. "A service worker is a script that your browser runs in the background, separate from a web page, opening the door to features that don't need a web page or user interaction."
Full article on this topic: https://developers.google.com/web/fundamentals/primers/servi...