Re: [PHP-DEV] PHP 4.0 Bug #8017: PHP ignores "If-Modified-Since" headers From: Frank M. Kromann (fmk <email protected>)
Date: 11/29/00

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

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>