HTTP/1.1 Cache-Control 无缓存问题
我不希望我的 Java SWT 应用程序缓存临时 Internet 文件。目前我正在处理IE(因为SWT使用本机浏览器),并且浏览器无法更改。
“Cache-Control: no-cache”似乎对我显示的每种文件类型都适用,除了 wmv。我的“Expires”设置为0。我尝试了各种缓存控制配置,包括无缓存(不支持wmv)、无存储(不支持wmv)、私有(允许wmv播放但cahces临时文件) 、 max-age (无效果)等。 wmv 文件仅提供可点击的停止按钮。但点击停止和播放没有任何作用。
浏览器用WMP显示媒体文件,所以我不明白为什么wmv不能播放但mp3/mpg工作正常(也在WMP中播放)。
我的响应标头中是否缺少某些内容,会强制临时文件不缓存并让 wmv 播放?我在网上找不到任何有关 no-cache 和 wmv 问题的信息。
I do not want my Java SWT application to cache temporary internet files. Currently I am dealing with IE (because SWT uses the native browser), and the browser cannot be changed.
The "Cache-Control: no-cache" seems to work fine for every file type I display, except wmv. My "Expires" is set to 0. I have tried all kinds of cache control configs with no-cache (no go for wmv), no-store (no go for wmv), private (allows wmv to play but cahces temp files), max-age (no effect), etc. The wmv file comes up with only the stop button clickable. But hitting stop and play do nothing.
The browser displays media files with WMP, so I do not understand why wmv will not play but mp3/mpg work fine (which are also played in WMP).
Is there something I am missing in my response header that will force the temp files to not cache and will let wmv play? I cannot find anything online about there being issues with no-cache and wmv.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的响应标头存在轻微的格式问题,因为它没有以两个“\r\n”字符串结尾。我的缓存控制标头在字符串末尾只有“\n”,并且名为 Fiddler 的实用工具在格式化时报告了此错误。
wmv 现在可以工作,并且不会对任何文件类型进行任何缓存。
There was a slight formatting issue with my response header in that it did not end with two "\r\n" strings. My cache-control header only had "\n" at the end of the string and a utility tool called Fiddler reported this error in formatting.
The wmv does now work and nothing is cahced for any file type.