header nocache not working as expected
The header on my site script includes the following:
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");
These lines are called prior to any output/whitespace.
This is what is showing in my live header viewer:
Note that the headers of the script specify that the browser not cache the page. The Expires date is before the current date.
Why is this not working?
I just tested here with firefox and chrome (just in case) and it seems to be working!
- OS: Mac OS X Lion
- Server: Nginx 1.2
- PHP: 5.3
My guesses: maybe your http server or php version has some kind of bug. So maybe, you should try to update both or test with another http server.