Re: 304 Not Modified

From: Date: Thu, 06 Sep 2001 10:28:56 +0000
Subject: Re: 304 Not Modified
Groups: php.general 
Request: Send a blank email to php-general+get-66192@lists.php.net to get a copy of this message
The problem is that PHP has to generate the Last-Modified header, so it can't send only the "HTTP/1.0 304 not modified", that is what I want. I think Last-Modified relies on the last modified date and time of the file, but this is irrilevant in server-generated pages. Thank you for your help. > ---------- Initial message ----------- > > From : Christian Reiniger <creinig@mayn.de> > To : "Ouster" <ermannov@libero.it>, php-general@lists.php.net > Cc : > Date : Thu, 6 Sep 2001 11:53:50 +0200 > Subject : Re: [PHP] 304 Not Modified > > On Wednesday 05 September 2001 21:22, Ouster wrote: > > I'm making a sort of cache system. I fell to this problem: I leave a > > cookie with the timestamp of the last access, and when the user > > reconnect, I compare the timestamp of the last change with the > > timestamp sent me with the cookie. Then I leave a new cookie. > > > > So: > > if($last_modified <= $last_access) > > { > > header("304 Not Modified); > > exit; > > } > > else > > { > > /* code genertating the new page */ > > } > > Tip: You don't even need a cookie for that. If you send a > "Last-Modified: " header along with all your pages (and perhaps even if > you don't), the browser will automatically add an "If-Modified- Since:" > header on each request. See the attached files for how to handle this > > > Whether the If is TRUE, I get a blank page, else I see a new page > > (correct behaviour). > > Why I always get a blank page and not the cached page? > > (see other responses) > > -- > Christian Reiniger > LGDC Webmaster (http://lgdc.sunsite.dk/) > > /* you are not expected to understand this */ > > - from the UNIX V6 kernel source >

« previous php.general (#66192) next »