RE: Disable all caching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I have a php (ver 4.x) script that is being cached.
> I have placed:
> <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
> but the page is still being cached.  I'm not sure if its apache or  the 
> php.  How can I disable all caching?
> is there something I can set in php.ini?
>
> (Mac OS X Server)
>
> Thanks
>
> Ben
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> 

Try adding this to your php page

<code>

if(!strpos(strtolower($_SERVER[HTTP_USER_AGENT]), "msie") === FALSE) {
   header("HTTP/1.x 205 OK");
} else {
   header("HTTP/1.x 200 OK");
}	
header("Pragma: no-cache");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, cachehack=".time());
header("Cache-Control: no-store, must-revalidate");
header("Cache-Control: post-check=-1, pre-check=-1", false);

</code>

Hope that helps,

Brad

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux