News for hackers. Stuff that matters.
Re:Writing a Service Worker by franciscop on Sunday July 09, 2017 @10:24AM (#14729855)
Ah this is really nice but still feels quite verbose (+the web standards are know for their bad documentation for end devs). A small library with good documentation making things easier could kill it, similarly to localstorage, cookies, etc.
Re:Writing a Service Worker by davideast on Sunday July 09, 2017 @10:27AM (#14729873)
I highly recommend using Workbox: https://workboxjs.org/.

One of the more gnarly parts of ServiceWorker is having to clean up old caches during a version change. The workbox-build module generates revision hashes for your pre-cached assets and handles any cache clean ups for you.