In some rare cases, you need to ask user to refresh the browsser to update the version. Maybe because some secrity issues. As we have learnt so far. And code change will generate a new service work in the waiting list. Unitl the current service worke…
Once serive worker is registered, the first time we go to the app, we cannot see the logs from servcie works. Any only refersh it second time, then we able to see the logs. Once we change service worker, it doesn't seem that we have change it. The No…
Service worker stays between our browser and noetwork requests. It can help to fetch data from cache and cache the data from Internet. To get our service worker, we need to : Register the service worker. Service worker in our code is just a javascirp…
Service Worker是什么 service worker 是独立于当前页面的一段运行在浏览器后台进程里的脚本.它的特性将包括推送消息,背景后台同步, geofencing(地理围栏定位),拦截和处理网络请求. 这个 API 会让人兴奋的原因是,它可以使你的应用先访问本地缓存资源,所以在离线状态时,在没有通过网络接收到更多的数据前,仍可以提供基本的功能(一般称之为 Offline First). 在 service worker 之前,另一个叫做 APP Cache 的 api 也可以提供…
前言: 以前学习基础知识的时候总看别人写的入门文章,但有时候还是一脸懵逼,直到自己用心阅读了MDN的英文文档才对基础知识的一些理论有了更深的理解,所以我在边阅读文档的时候边记录下帮助比较大的,也方便大家简洁学习.建议英文不好的同学可以先看我之前学的中文版基础知识再来学习这篇英文整理.Service Worker基础知识整理 Service worker concepts Service workers essentially act as proxy servers that sit betwe…