用于动态图像的 HTML 5 应用程序缓存

发布于 2024-11-26 04:30:20 字数 183 浏览 2 评论 0原文

我有一个应用程序清单现在可以很好地缓存我的应用程序。但是,我有一个部分会定期轮询服务器,并根据应用程序的状态渲染回不同的图像。这些图像不会被缓存(考虑缓存它们是不现实的),因此每当 ajax 调用尝试在屏幕上绘制新图像时,它们就会显示为损坏。

当我关闭应用程序缓存时,一切正常...如何允许应用程序在网络上查找某些文件而不是仅查看缓存?

I have an application manifest working nicely now to cache my app. However, I have one section that polls the server regularly and will render back different images depending on the state of the app. These images are not cached (it is not realistic to consider caching them), so they show as broken whenever that ajax call tries to draw new images on the screen.

Everything works fine when I have the appcaching off... how do I allow the app to look to the web for certain files instead of only looking at the cache?

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

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

发布评论

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

评论(1

oО清风挽发oО 2024-12-03 04:30:20

您将这些文件放在 清单文件中的NETWORK部分。网络部分中的任何内容都将始终从网络中获取。当然,您仍然需要设置适当的 HTTP 标头,以防止浏览器缓存存储这些图像,并且根据定义,当应用程序离线使用时,NETWORK 部分中的任何文件都将不可用。

You put those files in a NETWORK section in the manifest file. Anything in the network section will always be fetched from the network. Of course, you still have to set appropriate HTTP headers to prevent the browser cache storing those images, and any file in the NETWORK section will, by definition, be unavailable when the app is being used offline.

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