httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rasmus Lerdorf <ras...@lerdorf.on.ca>
Subject Re: Apache 2.0/NSPR
Date Thu, 10 Sep 1998 00:12:11 GMT
> It's actually fairly simple to deal with: You have the PHP module tag the
> response as uncacheable unless you get specific information (via a PHP
> function or something) from the script about what dimensions it acts on.

Yup, I see no problem with this.  

> P.S. A quick thought: it might not be that hard to determine the
> dimensions of a PHP script from the parser. You just need to classify each
> PHP function as to whether, passed the same arguments, it will return the
> same value every time. If it does, you can ignore it. If it doesn't, you
> need to specify what request dimensions it depends on, or if it depends on
> a non-request dimension (e.g., rand()). You should be able to put that
> together to figure out the proper metadata. But I may be missing some
> important factor.

Interesting thought.  Anything that talks to an external source would of
course need to be labelled uncacheable.  But you are right about the
trivial cases.  A lot of people use PHP to just include some other files
and call some simple display functions.

ie.

 <? 
    include "common.inc";
    show_header();
 ?>
 Static HTML
 blah blah
 <? show_footer() ?>

In a common case like this as long as the stuff done by common.inc does
not do any time, rand or external access stuff, it should be cacheable.
I just need to keep an internal state and have each uncacheable function
set it if used.

-Rasmus


Mime
View raw message