How to tell?
Posted: Sun Oct 17, 2010 2:30 pm
Hi guys, I have just added this to the top of one of my pages:
How do I tell if the caching is working? One of my scripts is causing a problem with the server its hosted on because bots keep on hitting it from the same IP, so I was thinking a cache would help.
Daniel
Code: Select all
<?php
$expires = 60*60*24*14;
header("Pragma: public");
header("Cache-Control: maxage=".$expires);
header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
?>Daniel