Re: PHP 4.0 Bug #8017: PHP ignores "If-Modified-Since" headers

From: Date: Wed, 29 Nov 2000 18:47:44 +0000
Subject: Re: PHP 4.0 Bug #8017: PHP ignores "If-Modified-Since" headers
Groups: php.dev 
Request: Send a blank email to php-dev+get-39616@lists.php.net to get a copy of this message
Hi, >The way it would work is very simple -- >PHP, from how I understand it, has two phases, first where it collects the >headers, and then where it outputs the body. At the moment where it starts >to output the body, it should compare the Last-Modified header outputted by >the script (if any) against If-Modified-Since. If (Last-Modified > >If-Modified-Since), it proceeds normally and sends back a 200 code. If >(Last-Modified <= If-Modified-Since), it would not output any body -- >ignoring all "echo"s in the script and further HTML in the document. The >script, however, continues to execute normally, completely oblivious that no >body is being sent out. > For what reson would you continue processing the script and block all output to the client ? For most scripts I know the parsing of the script is more time (and cpu) consuming than actually sending content to the client. The approacy I sugested in an earlier mail actualy handles this. The server do not spen time on enything else than cecking for changed content and sending out the 304 header. This way your server will be able to handle more hits. - Frank

« previous php.dev (#39616) next »