Wednesday, April 29, 2009

PHP - How to prevent/disable caching by proxy server

Add the following code into the very top of your php script.


header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s", time() + 300) . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");


Hope this help :)

1 comment:

小龍馬 said...

轉帖 : http://forum.bisik.net/thread-1054-1-1.html