0

注销时如何禁用浏览器缓存。我用了:

<meta http-equiv="cache-control" content="no-cache"> <!-- tells browser not to cache -->
<meta http-equiv="expires" content="0"> <!-- says that the cache expires 'now' -->
<meta http-equiv="pragma" content="no-cache"> <!-- says not to use cached stuff, if there is any -->

但是当我单击注销时,我仍然得到上一页。

4

1 回答 1

0

这应该适用于大多数浏览器,但为了防止 Firefox 缓存,您需要额外的两个标头Cache-Control=no-storeCache-Control=must-revalidate. 因此尝试:

<meta http-equiv="expires" content="0">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="cache-control" content="no-store">
<meta http-equiv="cache-control" content="must-revalidate">

看看我怎样才能防止 Firefox 缓存

于 2012-07-16T19:01:14.663 回答