Forum Moderators: coopster
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
However, IE doesn't seem to care :(
It still caches the pages... Any idea what might be wrong?
Normally I would put all this in .htaccess, but the @$%# who initially installed Apache compiled PHP/Perl/MySQL etc as dependencies of Apache, instead of loading them as modules. And, neither mod_expires nor mod_headers were compiled with Apache. So, if I wanted to either mod_, I would have to recompile not only Apache but also MySQL/PHP/Perl... (as far as I can tell). Either way, I'm not in the mood to recompile Apache at all :)
So, the reason why the PHP headers are failing -- is that related to the absence of mod_expires or mod_headers? Is there anything I can do to get the browser to not cache the page?
Any help is, as always, greatly appreciated.
:)
Yes! IE doesn't seem to care.
hehehe, sorry, couldn't help it. stupid IE.
I don't believe the absence of mod_expires or mod_headers has anything to do with your solution not working since the PHP header function sends raw HTTP headers.
Have you tried the example in the PHP header [php.net] manual pages?
<?php
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");// Always modified
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);// HTTP/1.0
header("Pragma: no-cache");
?>