0

Webworker - Webworkers provide scripts that run in a separate thread and don't freeze UI.

Service Worker - Service Workers provide scripts that provide "rich offline experience, push notification, background sync".

To me it seems that "Service Worker" also runs in the background but also does some other stuff.

So, why to use Webworkers at all if Service Worker can do extra work?

Can someone clarify me?

https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers

https://developers.google.com/web/fundamentals/primers/service-workers

Note: Already read Service Worker vs Web Worker - this is pretty small and doesn't cover this topic.

Deadpool
  • 7,811
  • 9
  • 44
  • 88
  • If you're going to ask a discussion/opinion question, it would probably be better to direct it to the javascript chat room: https://chat.stackoverflow.com/rooms/17/javascript – Taplar Aug 25 '20 at 18:26
  • Hi @Taplar - could you please provide any insights or details to the question, before asking it to close? would be helpful -- I've been hanging out to find the answer. – Deadpool Aug 25 '20 at 18:31
  • Again, this is an opinionated question. One person could answer that you should use web workers, and another could say you should use service workers. And so long as they are honest, both answers would be correct when matched up with your question. If you should or should not use web workers vs service workers, should be considered in a more restricted scope. Or provide criteria for the people who want to answer, so they know what information they need to provide for a reduced scope "correct" answer. – Taplar Aug 25 '20 at 18:34

0 Answers0