27-08-2008

PHP No-cache headers

These php headers wil prevent client side caching of your php output:

<?php
	//no  cache headers 
	header("Expires: Mon, 26 Jul 1990 05:00:00 GMT");
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
	header("Cache-Control: no-store, no-cache, must-revalidate");
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Pragma: no-cache");
?>

Comments:

6 comments.
Your comment:

»
musau 05/08/2009, 11:02 am
what?
lolwut 31/07/2011, 3:00 am
wut?
oOo 01/05/2012, 12:30 pm
wtf?
O_O 08/05/2012, 9:06 pm
woah?
pepies 30/06/2012, 3:52 pm
rly usefull, thx :)
Mitali 26/09/2011, 12:36 pm
Great :) :) It is working nicely!

Thanks

 

[x]