9. UNDERSTAND THE USER BASE
▸ Users in infrastructure low environments require offline access
▸ However…
▸ Devices used may dictate the ability to access service workers
21. MUCH MORE THAN JUST OFFLINE
▸ Push Notifications
▸ Background syncs
▸ Local downloads
▸ Load balancer
▸ Create a virtual server
▸ Conduct API Analytics
22.
23. PARSING & REGISTRATION
The browser meets the requirements
Service worker is not registered
The service worker has changed (bytes)
LIFE CYCLE OF A SERVICE WORKER
30. GET INTO THE BROWSER
Set default (update on reload)
Inspect service worker
BEGINNER TIPS
Error handling
Debugging
31. LEARN TO LOVE A GOOD PROMISE
And if you can, upgrade to async/await
BEGINNER TIPS
Helps with clean code
Error handling
Conditionals
Much more
32. DON’T GET STUCK ON THE SAME SCREEN
Develop a cache invalidation strategy
BEGINNER TIPS
Add feature flag to control unregistration
Have a no-op Service Worker at the ready
Force Update for version control
33. GET A HELPING HAND
▸ Service worker generator tools
▸ Workbox
▸ sw-precache + sw-toolbox
▸ generate-service-worker
BEGINNER TIPS
▸ Cookbooks
▸ Jake Archibald’s Offline Cookbook
▸ Mozilla’s Service Worker Cookbook