首次加载
install
cache resources
页面
sw.js(激活)
5. sendEvent
cache
5. fetch resources
2. register
2. get resources
非首次加载
3. fetch('/sw.js') and install
sw.js
delete old cache(首次激活触发)
1. fetch
4. fetch('/sw.js')[HTTP200: to install update]
安装更新后续流程参考\"首次加载\"
fetch
activate
4. sendEvent
ServiceWorker
3. register
6. cache resources