gpt4 book ai didi

google-chrome - 如何使用元标记防止在谷歌浏览器中缓存

转载 作者:行者123 更新时间:2023-12-04 18:02:05 24 4
gpt4 key购买 nike

是否可以通过编程方式阻止在 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 完全忽略了这一点。

有没有办法做到这一点?

提前致谢。

最佳答案

您可以尝试使用 HTTP 响应 header ,而不是 HTML 元标记:参见 Disabling browser caching for all browsers from ASP.NET .

如果您询问有关禁用输入元素中的数据缓存的信息,请参阅 How to prevent google chrome from caching my inputs, esp hidden ones when user click back?

关于google-chrome - 如何使用元标记防止在谷歌浏览器中缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33629822/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com