如何支持多个自定义缓存清单以供离线使用(逐个用户)?
我的应用程序使用项目的概念,每个项目都有多个需要离线使用的支持文件(主要是图像文件和 pdf 文件)。我想使用 HTML5 缓存清单来完成此任务。
如果我将所有项目的所有支持文件都包含在缓存清单中,那么它将变得庞大且不可行。 (即移动设备上没有足够的空间,这完全是多余的,用户只需要他们分配到的项目的支持文件)
用户被分配到项目,所以理想情况下我可以有一个自定义的缓存清单每个用户的文件,其中包含该用户分配到的项目所需的支持文件。
我怎样才能做到这一点?有没有办法在浏览器加载初始页面后分配不同的缓存清单?
如果没有,还有什么方法可以实现此功能?
Possible Duplicate:
HTML5 Cache — Is it possible to have several distinct caches for a single URL?
My app uses the concept of Projects, each Project has multiple support files (primarily image files and pdf's) that need to be made available offline. I want to use HTML5 cache-manifest to accomplish this.
If I include all the support files for all the projects in the cache-manifest it would be massive and not feasible. (I.e. there wouldn't be enough room on the mobile devices and it would be complete overkill, users only need the support files of the projects they are assigned to)
User's are assigned to Projects, so ideally I could have a custom cache-manifest file for each user that contains the support files needed for the projects that user is assigned to.
How can I accomplish this? Is there a way to assign a different cache-manifest after the browser has loaded the initial page?
If not, what is another way to accomplish this functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题: HTML5缓存 — 是否可以为单个 URL 提供多个不同的缓存? 非常相似,并提出了使用 iframe 的解决方案。我还没有尝试过,但它出现在我的搜索中这个问题旁边。祝你好运!
This question: HTML5 Cache — Is it possible to have several distinct caches for a single URL? is very similar and proposes a solution using iframes. I haven't tried it but it came up in my search next to this question. Good luck!