gaojinguan 发表于 2017-3-30 12:18:58

PHP 禁用IE缓存

function disableIECache() {
      // Disable IE8's cache
      $browser = JBrowser::getInstance();
      $userBrowser = $browser->getBrowser();
      $version = $browser->getMajor();
      if ($userBrowser == 'msie' && $version <= '8') {
         disablePageCaching();
      }
   } 
function disablePageCaching()
   {
      header ("Expires: Mon, 26 Jul 1997 01:00:00 GMT"); // Date in the past
      header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
      header("Cache-Control: no-store, no-cache, must-revalidate");
      header("Pragma: no-cache");
   }
页: [1]
查看完整版本: PHP 禁用IE缓存