用于动态图像的 HTML 5 应用程序缓存
我有一个应用程序清单现在可以很好地缓存我的应用程序。但是,我有一个部分会定期轮询服务器,并根据应用程序的状态渲染回不同的图像。这些图像不会被缓存(考虑缓存它们是不现实的),因此每当 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您将这些文件放在 清单文件中的
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 theNETWORK
section will, by definition, be unavailable when the app is being used offline.