Re: [PHP-DEV] PHP 4.0 Bug #8017: PHP ignores "If-Modified-Since" headers From: Jordan Russell (jr-phplist <email protected>)
Date: 11/29/00

> >When you have a client that visits a page 10 times a day, and the content
> >never changes, the server is sending that web page 9 times more than
> >necessary. If the script were to send a Last-Modified header, and PHP
> >handled If-Modified-Since appropriately, the page would only be sent once
to
> >the client; subsequent requests would be pulled out of the web browser
> >cache. Not only does this conserve bandwidth on the server end, it also
> >makes the page come up significantly faster for the client. So it's a
> >win-win situation for everyone.
>
> In other words, You require the developer to send an extra header in order
for the engine to take care of caching. Why cant the developer send the
extra header and make checks accordingly ? Most of the work will be done in
the script anyway. You need to do this in the script to dertermine if the
content of databases or other systems has changed. As a developer you will
also be able to exit the script after sending the 304 header. You dont need
any extra php functions to handle this.

The reason why I think it should be built-in is because parsing
If-Modified-Since is complicated -- the HTTP spec allows a number of
different date formats. I think it's unreasonable to expect every PHP
develeper to write his own If-Modified-Since parser (or obtain a third-party
one) if they want to use Last-Modified-style caching. Not only that, it
would run a whole lot faster in native C.

I've produced a working patch for PHP 4.0.3pl1 which I'll post shortly...

Jordan Russell

-- 
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>