html5 appcache加载顺序

发布于 2024-12-28 14:21:32 字数 144 浏览 5 评论 0原文

我正在创建一个包含大量视频/大图像的应用程序,它将使用应用程序缓存来处理它们的预加载。

有没有办法让我控制这些资产的加载顺序?例如,我想在子页面上加载主页上的大图像/视频之前。我尝试按照我希望它们在应用程序缓存清单中加载的顺序列出文件,但这似乎没有什么区别。

I'm creating an app with a number of videos/large images that will use appcache to handle the preloading of them.

Is there a way for me to control what order those assets get loaded? For example, I would like to load the big image/video on the homepage before the ones on the sub pages. I have tried listing the files in the order I want them to load in the appcache manifest but that didn't seem to make a difference.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萧瑟寒风 2025-01-04 14:21:32

以什么顺序下载它们并不重要。Appcache 操作是原子的。在应用程序缓存中对该清单文件的所有内容都可用之前,应用程序缓存中无法提供该清单文件的任何内容。

如果您想分解下载,那么正如 @PaulGrime 建议的那样,拥有多个清单文件。您需要让用户访问每个清单的主机页面,但您应该能够使用隐藏的 iframe 或其他内容来管理它。

It doesn't matter what order they're downloaded in. Appcache operations are atomic. Nothing is available from the appcache for a particular manifest file until everything is available from the appcache for that manifest.

If you want to break up the download then, as @PaulGrime suggests, have multiple manifest files. You will need to have the user visit the host page for each manifest but you should be able to manage that with a hidden iframe or something.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文