Offline Experience with Service Worker

@MichalZalecki

woumedia.com

navigator.onLine // false
navigator.onLine // ture
navigator.serviceWorker.register("/sw.js")

life cycle

self.addEventListener("install", event => { ... })
self.addEventListener("activate", event => { ... })
idle…
self.addEventListener("fetch", event => { ... })
…terminated
waiting… or self.skipWaiting()

Strategies (selected)

  • Network first
  • Cache first
  • Cache first and update
  • Offline fallback

More: https://jakearchibald.com/2014/offline-cookbook/

<             />

  • AliExpress increased conversion rates for new users by 104%.

  • United eXtra Electronics saw 4x increase in re-engagement and 100% more sales from users arriving via web push.

  • 5miles decreased bounce rate by 50% and increased conversions by 30%.

Source: https://cloudfour.com/thinks/the-business-case-for-progressive-web-apps/

https://alistapart.com/article/application-cache-is-a-douchebag

Thank you!

Questions?

Offline Experience with Service Worker

By Michał Załęcki

Offline Experience with Service Worker

  • 1,625