注销发生时不活动的浏览器缓存

时间:2012-07-16 06:27:35

标签: java jsp

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

<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 -->

但是当我点击退出时,我仍然会收到上一页。

1 个答案:

答案 0 :(得分: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">

请参阅how can i prevent firefox caching