Codeigniter禁用管理面板的浏览器页面缓存

时间:2017-07-18 09:06:59

标签: php codeigniter session caching

我正在使用codeigniter 3.1.5 HMVC开发一个网站,现在我正在编写管理面板。

我设计了登录屏幕和仪表板面板。我可以成功登录和注销,会话等没有问题。

但我的问题是,我的浏览器(Chrome)正在缓存我的仪表板页面,在注销后,当我点击浏览器上的“返回”按钮时,我可以看到缓存的仪表板页面,但我想禁用它。 (当我刷新页面时,它会将我重定向到登录面板)

我怎么理解问题出在浏览器上?

我正在我的本地wamp服务器上开发该站点。注销后,我停止了wamp服务器并单击Go Back按钮并浏览器加载页面(但它不应该加载,因此它来自浏览器的缓存)

我在我的控制器的每个位置(在构造函数中或在注销后等)尝试了这些代码,但它没有解决问题。

org.apache.spark.ml.classification.BinaryLogisticRegressionTrainingSummary@6e9f8160

如何解决此问题? 谢谢,最好的问候。

1 个答案:

答案 0 :(得分:0)

不确定但使用max-age = 0

的给定标头Cache-Control代码
$this->output->set_header("HTTP/1.0 200 OK");
$this->output->set_header("HTTP/1.1 200 OK");
$this->output->set_header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
$this->output->set_header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
相关问题