httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@leland.Stanford.EDU>
Subject Re: Apache 2.0/NSPR
Date Wed, 09 Sep 1998 23:58:45 GMT
On Wed, 9 Sep 1998, Rasmus Lerdorf wrote:

> > (this last one can be done in the kernel, or in an otherwise streamlined
> > manner. Much speedup. And the neat thing is that neither the database nor
> > mod_php have to know *anything* about it, as long as they properly report
> > their metadata. We'll need to make that sure that's easy for module
> > authors to have their modules do.)
> Well, it goes a step beyond that.  I would have to pass this on to the
> actual PHP script author.  I can't analyze a PHP script and determine the
> metadata.  Well, I could try, but there are so many different ways that a
> script can vary from one hit to the next that it wouldn't be feasible.

Yeah, that's the problem with generalized scripting languages. They're
too damn general ;)

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.

As I mentioned earlier, this actually is a point in favor of the plan I
outline: In the current HTTP cache system (e.g., Apache+Squid), if any
part of the response has unknown dimensions, we have to treat the whole
thing as uncacheable. With cached layering, we can at least cache the
parts of the request we can define.

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.

-- Alexei Kosut <> <>
   Stanford University, Class of 2001 * Apache <> *

View raw message