HTTP/1.1 Cache-Control 无缓存问题

发布于 2024-08-07 04:11:40 字数 406 浏览 3 评论 0原文

我不希望我的 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 技术交流群。

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

发布评论

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

评论(1

谁对谁错谁最难过 2024-08-14 04:11:40

我的响应标头存在轻微的格式问题,因为它没有以两个“\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.

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