2016/Brighton/serviceworkers
Service Workers Use Cases was a session at IndieWebCamp Brighton 2016.
Notes archived from: https://etherpad.indieweb.org/serviceworkers
IndieWebCamp Brighton 2016 Session: service worker use cases
Participants
- Jeremy Keith
- Glenn Jones
- Andrea Rota
- Sven Knebel
- Sebastian Lasse
- Martin Tomes
- Erik Erskine
Notes
- basics: can intercept and handle failures for HTTP access to resources on a page
- require HTTPS
- installed via JS
adactio:
- caches index pages -> offline readable
no magic, everything has to (but can be) implemented as desired using relevant APIs:
- Cache API (intercept requests, store/fetch results to/from cache)
- BackgroundSync API allows to schedule requests for later https://github.com/WICG/BackgroundSync/blob/master/explainer.md
- notifications API (also allows notifications when the browser is closed)
- postMessage API (send message between tabs and service worker)
use cases (easy -> complex):
- cache assets
- custom offline page
- cache first, then update
- network first -> start timer, if network to slow use cache
- allow user to store individual sites in local cache (e.g. read later)
- cached shell available: service worker can mark requests and only fetch partials and build them together