DEV Community

loading...

Do you use Service Workers in production? How has your experience been like?

Sammy Israwi
Software Developer who works mostly on Web stuff. I like JS, but I also like other things. I also do photography, and look at sneakers online that I will never be able to buy.
・1 min read

If you have used Service Workers in production, I'd like to hear about it!

  • How did you realize you needed them?

  • How was your experience setting it up, and maintaining it?

  • Results? Demos?

Thank you all!

Discussion (7)

Collapse
qm3ster profile image
Mihail Malo

Even with dirt-cheap CDNs it seems like the respectable thing to do.
Especially for mobile devices. No CDN will solve poor last-mile connectivity, or save users data.

The main trap people fall into, in my experience, is thinking of it as "HTTP cache++", and just applying it to unstructured sites.

If you want a quality offline-first experience, you need to approach your product, from the get go, as an application. (Which just happens to be written with web technologies).

It is tremendously easier to add SSR to an offline-first, well-structured application using best practices than it is to make even a subset of your SSR-first application provide a usable offline experience.

Collapse
callistom profile image
callistorr90

Used it for a PWA, worked perfectly for caching certain things. Have not yet tried the offline capabilities.

Collapse
sammyisa profile image
Sammy Israwi Author

Why not? Do you not need it? Or is the effort not worth it in your case?

Collapse
callistom profile image
callistorr90

Not really needed in my case but maybe for the next PWA or some future release.

Collapse
xeewi profile image
Guillaume Gautier

I actually trying to use it on a ionic app, specially for the offline mode. It's simply not working for me lol.
Working perfectly on the navigator, but when the app is running on device that not working anymore

Collapse
likebrain profile image
Ricardo Rivera

Hey, you must get the pwa from a secured Location... in Ionic Cordova eg. file:// are not ssl secured. Use a remote-Location like webapp.myserver.com in Cordova + Cordova-whithlist-plugin and serviceworker run in Cordova... in some cases you need to ad crosswalk also...

send with phone

Collapse
pungiish profile image
Jan

Can't figure out how to con figure it for both aot build and then for production where the folder doesn't have the aot suffix..