Navigation Timing & Service Worker
Instructions:
- Load any page on this origin once so the service worker can install.
- Load test page
/?respondFromSW=true
to test condition:
- Fetch event calls
event.respondWith()
- Load test page
/?respondFromSW=false
to test condition:
- Fetch event DOES NOT call
event.respondWith()
- Open the console to see the Navigation Timing values logged:
Behavior:
- Service worker script should block for ~200ms during start up
- Service worker
fetch
event should block for ~500ms before calling event.respondWith()
- Promise passed to
event.respondWith()
should take ~1000ms to resolve