鉴于这些要求,我应该如何构建我的HTML5清单呢? [英] How should I structure my HTML5 manifest given these requirements?

查看:150
本文介绍了鉴于这些要求,我应该如何构建我的HTML5清单呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个HTML jquerymobile应用程序,当用户尝试从主屏幕加载应用程序时,我需要显示一个离线页面。

I have a HTML jquerymobile App, I need to show an offline page when the user tries to load the app from their home screen.

我想要的页面看到的是离线。离线.jsp。问题是,如果我在用户访问的每个页面上都包含HTML清单,那么该页面最终会被缓存,这意味着当用户离线加载应用程序时,他们有时会看到他们访问过的页面但图像丢失等,我不想要我想要一个只缓存某个页面的干净缓存系统。

The page I want them to see is gone-offline.jsp. Problem is, if I include the HTML manifest on every page the user visits, that page ends up getting cached, which means when the user loads the app offline, they sometimes see the page they visited but images are missing etc, I do not want that, I want a clean caching system that only caches a certain page.

是否有可能阻止其他页面在用户访问时缓存。

Is it possible to prevent the other pages getting cached when user visits them.

我想要的只是缓存一个JS文件,它检查导航器是否在线,如果没有重定向到那个离线页面..

What I'd like is to just cache a little JS file which checks if navigator online, if not redirects to that gone-offline page..

推荐答案

参见这个问题有助于:

总之,使用如下所示的清单:

In summary, use a manifest which looks like this:

CACHE MANIFEST
CACHE:
/gone-offline.jsp

FALLBACK:
/ /gone-offline.jsp

NETWORK:
*

这篇关于鉴于这些要求,我应该如何构建我的HTML5清单呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆