0

我的缓存有问题。当我访问我的网站时,我会看到旧主题,直到我点击 ctl+f5 来更新页面。有什么办法可以防止浏览器存储缓存?

我使用了这些元数据:

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">

但同样的结果

4

1 回答 1

0

使用以下标题:

Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

更多可以在这里找到

Edit1:正如链接中进一步提到的,在<head>and之间使用这些纯 HTML 标记</head>,看看它是否有效:

<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" />
于 2012-10-26T09:50:52.813 回答