【发布时间】:2016-03-08 02:45:08
【问题描述】:
我有一些缓存问题。我正在运行非常小的网络应用程序,它读取一帧,将其保存到磁盘,然后在浏览器窗口中显示。
我知道,这可能不是最好的解决方案,但是每次我用相同的名称保存这个读取帧时,任何浏览器都会缓存它。
我尝试使用 html 元标记 - 没有成功:
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
另外,我已经尝试过这个(特定于烧瓶):
resp.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
resp.headers["Pragma"] = "no-cache"
resp.headers["Expires"] = "0"
这就是我尝试修改 resp 标头的方式:
r = make_response(render_template('video.html', video_info=video_info))
r.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
r.headers["Pragma"] = "no-cache"
r.headers["Expires"] = "0"
Google Chrome 和 Safari 仍然进行缓存。
这里可能有什么问题?
【问题讨论】: