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 20:17:06 GMT
On Wed, 9 Sep 1998, Ben Laurie wrote:

> Alexei Kosut wrote:
> > By the way, I think I'm going to take advantage of some time next week
> > between when I stop working for C2Net and when I start school to play with
> > apache-nspr, and to see how the Magic Cache idea we talked about at the
> > core meeting last July might work with it. I've started looking at some
> > freely-available cache engines like Harvest, seeing if perhaps there's
> > code available somewhere we can use instead of writing our own.
> 
> Do things like Harvest really help? If the "Magic Cache" ends up on disk
> like a Harvest cache doesn't that rather defeat the object?

Harvest uses a RAM cache for meta-information and "hot objects", just like
Squid. And yes, an on-disk cache does help. Obviously not for flat files,
but for most other kinds, it does. That was Cliff's point, IIRC: If you
have a file backed by a very slow database, for example, you want to be
able to cache the result of that lookup. Even if it's stored on disk,
Apache's quite good at serving files from disk.

And imagine this scenario: You're pulling a file template out of a slow
database, then filtering that output through SSI or PHP or something,
filling it in with some on-the-fly information like the time of day or
cookie-customized colors or something (I dunno; use your imagination).
Let's say the database file only changes every hour, but the on-the-fly
stuff is different for each request. 

In this case, the advantages of having a cache act as the mediator between
all stages of request fulfillment become clear: The final output document
is not cacheable, so any external cache, proxy or accelerator (e.g.,
Squid) cannot help. But if Apache caches (on disk or wherever) the
layers of each response, then that database access will only occur once
every hour, instead of once per request.

*shrug* Sounds good to me. As I said, I'm planning to look into it.
Hopefully, we'll be able to figure out if the usefulness of it once we can
come up with some working code.

P.S. One note, though. Although some (hi, Simon) might disagree, I'm not
talking about using Harvest as a whole, just taking out the cache bit and
using that. As an alternative to writing our own cache. I tried that once
before and we ended up with the mess of a proxy we have now.

-- Alexei Kosut <akosut@stanford.edu> <http://www.stanford.edu/~akosut/>
   Stanford University, Class of 2001 * Apache <http://www.apache.org> *



Mime
View raw message