Matt Sergeant
> 
> On Wed, 12 Jul 2000, Luis Henrique Cassis Fagundes wrote:
> 
> >         How do I use Apache::Registry to cache pages in disk? The module
> > I have
> > in mind is something transparent to the programmer, you just tell apache
> > that some CGI (or PHP, or any request) will be cached and the server
> > will cache the stdout in disk, and next time someone requests a page,
> > the cached page will be sent.
> 
> Can you tell us more about exactly what you're trying to achieve? Surely a
> script based page is going to be dynamic, so a cache is irrelevant. Unless
> your script is just doing some sort of templating, in which case I highly
> suggest you check out AxKit or Mason, which both support this kind of
> caching (and EmbPerl is going to do it in the next release I hear).

I can see a case where a script would be semi-static, or semi-dynamic,
depending on how you look at it.  Consider a page built from a
database.  Say the database is updated every 15 minutes, or perhaps
irregularly.  In these cases the script would generate the same page
until the data changed.

The problem here is that you can't simply cache the page, because the
server and even the script can't know when to replace the cached page
until after its heard from the database or the source that is feeding
the database.  It can't be transparent to the programmer since it
requires some knowledge about how to test whether or not a new page
needs to be built.  A semi-static page can help performance here if
the db query is slowish and the page is requested more frequently than
the db changes.

I supose a two-step module could be constructed.  It would have hooks
to two external functions. One is a testing hook that returns a true
or a false depending on whether the cache is stale by some criterion.
The other is the build process that builds the page that will be
cached.  I've done this for single script/pages on an ad hoc bases,
and it works OK.  I'm not sure how generally useful it is or whether
it would deserve a module.

Then again, maybe this isn't even what Cassis has in mind.


> 
> -- 
> <Matt/>
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org | AxKit: http://axkit.org
> 


-- 
 John Edstrom | edstrom @ slugo.hmsc.orst.edu

 http://bubo.hmsc.orst.edu/~edstrom
 "Lurker" at BioMOO (bioinfo.weizmann.ac.il:8888)

 Hatfield Marine Science Center
 2030 S. Marine Science Drive
 Newport, Oregon     97365-5296
 wk: (541) 867 0197
 fx: (541) 867 0138

Reply via email to