home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / admin / nocache.inc < prev    next >
Encoding:
Text File  |  2003-03-16  |  966 b   |  25 lines

  1. <?php
  2. /********************************************************
  3.     include/icl.inc
  4.     
  5.     (C)Ryo Chijiiwa <Ryo@IlohaMail.org> 2002 
  6.  
  7.     This file is part of IlohaMail, and released under GPL.
  8.     See COPYING, or http://www.fsf.org/copyleft/gpl.html
  9.     
  10.     PURPOSE:
  11.         Sets HTTP headers to disable cache if using non-Netscape browser
  12.  
  13. ********************************************************/
  14. if (isset($HTTP_USER_AGENT)) $ua = $HTTP_USER_AGENT;
  15. else if (isset($_SERVER)) $ua = $_SERVER["HTTP_USER_AGENT"];
  16.  
  17. $isns = stristr($ua, "Mozilla") && (!(stristr($ua, "compatible"))) && (!(stristr($ua, "Safari")));
  18. if (!$isns){
  19.     header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
  20.     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
  21.     header("Cache-Control: no-store, no-cache, must-revalidate");  // HTTP/1.1
  22.     header("Cache-Control: post-check=0, pre-check=0", false);
  23.     header("Pragma: no-cache");                          // HTTP/1.0
  24. }
  25. ?>