Maxim Salnikov
@webmaxru
Developer Engagement Lead at Microsoft
A useful design pattern, not a formalized standard.
Service worker API
Networking
Caching
Capabilities
Installability
* but not everything**
** use progressive enhancement strategy
Service Worker API
Web App Manifest
My App
App
Service-worker
Browser/OS
Event-driven worker
Cache
fetch
push
sync
Service
worker
OS
Browser
Internet
App
Event
Event
Event
Event
Message
'install'
Parsed
Installing
Activating
Redundant
'activate'
Waiting
Active
self.addEventListener('install', event => {
// Use Cache API to cache html/js/css
})
self.addEventListener('activate', event => {
// Clean the cache from the obsolete versions
})
self.addEventListener('fetch', event => {
// Serve assets from cache or network
})
Maxim Salnikov
@webmaxru