Page 1 of 1

How to tell?

Posted: Sun Oct 17, 2010 2:30 pm
by Monotoko
Hi guys, I have just added this to the top of one of my pages:

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');
?>
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

Re: How to tell?

Posted: Sun Oct 17, 2010 2:52 pm
by John Cartwright
It is completely up to the client, or in your case a bot, to obey the caching rules.