
Ask HN: Do you use service workers for your web app? - praveenweb
I&#x27;m just curious to understand if anyone is using service workers for their web app in production and if so, what use cases does it solve particularly well.<p>More specifically, in terms of caching, apart from working offline how is it different from browser&#x2F;CDN cache? What if your service worker itself is cached for sometime and you want to rollout an update? What are the best practices? How has your experience been maintaining service worker on a production app? What about security?<p>I know notifications can be done, server push with HTTP&#x2F;2 etc. But which kind of web apps can make the best use of service workers and which ones shouldn&#x27;t implement it?
======
neilsimp1
I'm currently writing a PWA and using [https://www.npmjs.com/package/sw-
precache-webpack-plugin](https://www.npmjs.com/package/sw-precache-webpack-
plugin) to generate the service worker on each build. It's nice because it's a
whole chunk of what would otherwise be application logic that I now give zero
thought too.

------
Jack000
I use service workers on [http://svgnest.com](http://svgnest.com)

no idea about caching, I mainly use it max out all the cores for the cpu bound
algo.

its probably good for browser based cryptocurrency mining too.

~~~
detaro
That sounds more like web workers than service workers? (web worker: get
"background threads" for computation, service worker: intercept requests, get
custom caching strategies, ...)

~~~
Jack000
oh oops I guess mixed up the terms. I hope these apis stick around because
they seem kind of niche and under-utilized right now.

