People rarely say "this site has a great service worker". They say "it still worked on the train". Five small things make that happen:
- A real offline page. Your colours, a plain message and a retry button, instead of the browser's error. How
- A list of what is still available. Read the caches and link to pages people already opened. PWA.live's offline page does this.
- A timeout on network-first. On a weak signal, show the cached page after three or four seconds instead of a blank screen. How
- Save for offline. Let people keep the pages they care about. Every guide on this site has a button for it.
- Tell people what happened. A small "You're offline; showing saved pages" note, and "Back online" when it returns.
None of this needs a framework. Our service worker generator and offline page generator get you most of the way in ten minutes.