使用 ionic 3+ 在 pwa 中显示离线页面
Show offline page in pwa with ionic 3+
我想在我的 PWA 中显示一个用 ionic 3.9 制作的离线页面,
网络原生插件不支持浏览器,所以我们不能在 PWA 中使用网络,
当 phone 的互联网连接关闭时,我如何显示 angular 离线页面?
基于此blog, a PWA should be able to do some work offline using service workers。
Service workers essentially act as proxy servers that sit between web applications, the browser, and the network (when available). They are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server.
查看此 Offline Storage for Progressive Web Apps 文档。
- 对于离线加载应用程序所需的网络资源,请使用 Cache API (part of service workers)。
- 对于所有其他数据,请使用 IndexedDB (with a promises wrapper)。
我想在我的 PWA 中显示一个用 ionic 3.9 制作的离线页面, 网络原生插件不支持浏览器,所以我们不能在 PWA 中使用网络, 当 phone 的互联网连接关闭时,我如何显示 angular 离线页面?
基于此blog, a PWA should be able to do some work offline using service workers。
Service workers essentially act as proxy servers that sit between web applications, the browser, and the network (when available). They are intended, among other things, to enable the creation of effective offline experiences, intercept network requests and take appropriate action based on whether the network is available, and update assets residing on the server.
查看此 Offline Storage for Progressive Web Apps 文档。
- 对于离线加载应用程序所需的网络资源,请使用 Cache API (part of service workers)。
- 对于所有其他数据,请使用 IndexedDB (with a promises wrapper)。