如何在逐个用户的基础上支持多个自定义缓存清单以供脱机使用? [英] How to support multiple custom cache manifest for offline use, on a user by user basis?

查看:145
本文介绍了如何在逐个用户的基础上支持多个自定义缓存清单以供脱机使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

HTML5缓存—是否可以为单个URL提供多个不同的缓存?

我的应用使用Projects的概念,每个Project都有多个支持文件(主要是图像文件和pdf),需要离线使用。我想使用HTML5 cache-manifest来实现这一目标。

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)

用户的被分配给Projects,所以理想情况下,我可以为每个用户提供一个自定义缓存清单文件,其中包含分配给用户的项目所需的支持文件。

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?

推荐答案

这个问题: 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!

这篇关于如何在逐个用户的基础上支持多个自定义缓存清单以供脱机使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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