PHP4's default seems to be to prohibit browser caching. For some basically static pages, though, I want to allow browsers to cache the pages for a short amount of time.
I've tried the following code, which inserts an Expires header, but it doesn't seem to have any effect. Can anyone see what I'm doing wrong? Or does anyone have a better idea to control the browser caching?
<?php
$later = time() + 60603; // 3 hours from now
$header_str = 'Expires: '.gmstrftime('%A, %d-%b-%y %H:%M:00 GMT',$later);
header($header_str);
?>
Also, does anyone know how I can view what headers were sent in a browser? I just want to make sure the header is actually being sent and retrieved by the browser.
Thanks everyone. This group is such a great resource.
-Keegan