Another option is replace your direct DB calls with something that creates a
ready-to-go presentation and keeps it cached in Cache::MemCached or such.
We do this for "events" pages on our pages and have found it to cut processing
time by several orders of magnitude.
If you have LOAD_PERL on your can use it directly from your template... or you
can have a mod_perl handler do the lifting for you.
On Sun, Aug 06, 2006 at 09:29:02PM -0400, Robert James Kaes wrote:
> On Sun, 06 Aug 2006, Randal L. Schwartz wrote:
> > >>>>> "Robert" == Robert James Kaes
> > >>>>> <rjk-auz4xgPZSajD1m2VYDcomQ@xxxxxxxxxxxxxxxx> writes:
> >
> > Robert> I'd like to say "the output of all components are cached. If a
> > child
> > Robert> component has changed, invalidate the child cache and its parent's
> > Robert> cache." It would also be nice to selectively say "this component's
> > Robert> output must never be cached."
> >
> > I've looked at this a number of times, and never gotten very far. If I may
> > misquote Perrin, he's said something to the effect that the expense for
> > determining when to blow a cache (and how much to blow) often exceeds the
> > cost
> > of just recomputing the darn thing. And yes, it's a can of worms.
>
> Thank you, you raise a good point that I had not fully considered. My
> goal is to display a dynamically generated page, but where most of the
> "dynamic" content is actually static for a period amount of time. (Take
> a news page, for example, where the list of news stories updates once an
> hour.)
>
> Having thought about the problem a bit more, I can likely simulate what
> I'm looking for by using a template that INSERTs the "dynamic" content
> that was generated by a cronjob periodically. This would move the heavy
> DB processing offline relative to the page view.
>
> Randal, thank you for your insight!
>
> Have a great night.
> -- Robert
>
> --
> Robert James Kaes
> WormBytes Consulting and Contracting
> http://www.wormbytes.ca/
>
> _______________________________________________
> templates mailing list
> templates-MnLy+PD7ppGDO3lXZvfOKmD2FQJk+8+b@xxxxxxxxxxxxxxxx
> http://lists.template-toolkit.org/mailman/listinfo/templates
--
Todd Freeman Ext 6103 .^. Don't fear the penguins!
Programming Department /V\
Andrews University // \\ http://www.linux.org/
http://www.andrews.edu/~freeman/ /( )\ http://www.debian.org/
^^ ^^
signature.asc
Description: Digital signature
|