header("HTTP/1.1 304 Not Modified", TRUE, 304) - n
Posted: Sun Mar 09, 2003 10:52 am
Server: Apache/1.3.26 (Linux/SuSE) PHP/4.2.2
I have this code in the begining of my page:
After the command "header("HTTP/1.1 304 Not Modified", TRUE, 304)" has been executed. Apache still returns an 200 status to client (checked with a HTTP sniffer). This of course makes the page seem empty in the client, instead of the client using its cache. Has anyone got any ideas about why?
I've allso tried "header("Status: 304 Not Modified", TRUE, 304);" - with same result.
No text or other headers has been echoed or sent earlier in code.
Many thanks,
Frode
I have this code in the begining of my page:
Code: Select all
$row = mysql_fetch_object($result);
//last modified?
$gmt_mtime = gmdate('D, d M Y H:i:s', $row->modified) . ' GMT';
if (($_SERVERї'HTTP_IF_MODIFIED_SINCE'] == $gmt_mtime) and ($_SERVERї'REQUEST_METHOD']=='GET')) {
header("HTTP/1.1 304 Not Modified", TRUE, 304);
//header("Status: 304 Not Modified", TRUE, 304);
exit();
}
$lastmod_header = "Last-Modified: " . $gmt_mtime;
Header($lastmod_header);I've allso tried "header("Status: 304 Not Modified", TRUE, 304);" - with same result.
No text or other headers has been echoed or sent earlier in code.
Many thanks,
Frode