ERR_CACHE_MISS的解决方案

当页面的表单进行提交后,点击浏览器的返回按钮,页面会显示ERR_CACHE_MISSERR_CACHE_MISS的解决方案
经过查询资料,如果不想显示该页面的话,需要在先前提交表单的页面设置缓存:
<meta http-equiv=“Cache-Control” content=“max-age=7200” />
<meta http-equiv=“Expires” content=“Mon, 20 Jul 2013 23:00:00 GMT” />
将返回的页面重定向至新的页面 :客户希望能够返回特定的url,而不是跳到上一页,解决方法:
window.onpopstate = function(){
     window.location.href('your url ');
}
window.history.pushState(‘forward’, null, ‘#’);
window.history.forward(1);

以上设置在Chrome可行,但在Firefox,如果连续点击返回按钮,会提示文档已过期:ERR_CACHE_MISS的解决方案
出现该问题的原因是因为使用了session_start(),该函数会强制当前页面不被缓存
在它下面加上 header(“Cache-control: private”);
注意在此之前程序不能有任何输出;

相关文章:

  • 2022-03-13
  • 2021-12-13
  • 2021-05-28
  • 2021-11-23
  • 2021-12-07
  • 2021-11-27
  • 2021-07-06
猜你喜欢
  • 2022-01-21
  • 2021-10-30
  • 2021-05-07
  • 2021-09-05
  • 2021-06-16
  • 2022-12-23
相关资源
相似解决方案