如何使用PHP 5.3清除IE8浏览器缓存

时间:2012-03-16 07:00:07

标签: php internet-explorer caching clear

嗨我需要在加载基于cd的php应用程序之前清除IE8浏览器缓存。

我的php应用程序正在使用Dot net应用程序。所以在调用我的php应用程序之前,我试着像这样调用一个php页面。

<?php
    header("Pragma: no-cache");
    header("Cache: no-cache");
    header("Cache-Control: no-cache, must-revalidate");
    header("Expires: Mon, 01 Jan 2001 01:00:00 GMT");
?>

但它没有正确清除IE8缓存。如何使用php或jquery清除IE缓存?

如果有其他选择,请帮助我。 提前谢谢。

1 个答案:

答案 0 :(得分:1)

请将此代码添加到您的php页面

<?php
header("Expires: Tue, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>