UpUp 强制 offline.html 即使在线

UpUp to force the offline.html even when online

所以我正在尝试使用 UpUp 库来构建离线第一个网页。

当我离线时图书馆显示离线页面。如何强制UpUp无论在线还是离线都显示离线页面。

我想做的是构建类似的东西,应用程序 shell 将始终从服务工作者缓存中加载,并从那里进行网络调用。这将使我的应用程序加载速度更快,因为初始页面加载不会来自网络。

我不是 UpUp, but my understanding is that the library isn't intended to facilitate using the Application Shell model. Perhaps at some point it will evolve to fill that role, and you could always ask on the project's Issue Tracker 的作者。

与此同时,有一些资源描述了如何按照该模型构建应用程序,可以使用 sw-precache/sw-toolbox 库组合,也可以编写自己的服务工作者代码: