Web Hosting Talk







View Full Version : Is this PHP code ok ? - Cahce


Crazy BigGaz
05-27-2007, 04:56 AM
Hi,

I think my site is having a cache problem as on a refresh it different as I log the number of visitors, so I did a google and found the below code.

My question is, is this code ok, by this I mean will it affect search engines, rankings etc...

<?
//Set no caching
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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>

Regards,
Garry

niatech2006
05-27-2007, 11:29 PM
Yes, I use a similar set of function calls and it works quite well.