【发布时间】:2015-11-10 12:19:00
【问题描述】:
是否可以通过编程方式阻止在 Google Chrome 中缓存文件?
我想实现和chrome开发者工具中的“禁用缓存”选项一样的效果。
主要问题是我正在使用加载另一个脚本的外部脚本(我无法更改它) - 将其他(随机生成的)参数放入该脚本的源 url 将无济于事。
到目前为止,我已经尝试过使用元标记:
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="cache-control" content="no-store" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1990 12:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
在使用这些标签的不同组合进行测试后,我只能说谷歌浏览器完全忽略了这一点。
有什么办法可以做到吗?
提前致谢。
【问题讨论】:
标签: google-chrome caching browser-cache meta-tags