cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Hunsberger" <>
Subject Re: Pattern for use of sub-pipelines to grab content at different stages?
Date Wed, 24 May 2006 16:44:46 GMT
On 5/24/06, Craeg Strong <> wrote:


> Yes.  For us Toplink caches business objects (avoiding trips to database),
> the presentation tier caches certain long-lived DTOs (avoiding trips to
> backend),
> and also caches many of the Doms of XML that are produced (avoiding
> Java-to-XML generation via JDOM).
> However that still is not enough-- the XSLT processing itself--the
> transformers that produce the
> final content from generated XML--are taking too long.  We want to cache
> as much of that as we possibly
> can.  After all, XHTML is just XML, why shouldn't some of it be cached??

It can be, just be aware that it's cache validity is only as good as
the cache validity of the pipelines that feed it...

> > That's not to say the final result can't be cached.  It can, but it's
> > cache validity is only as good as the cache validity of that of the
> > shortest lived data component.
> I don't understand.
> I thought that each pipeline can be cached.
> My mental model is as follows:
> Say Pipeline A gets content from Pipeline A1 and A2.
> Pretend that three pipelines have several generators, transformers, and
> serializers, all of which are theoretically cacheable.
> Say A1 is cached for 1 second.
> Say A2 is cached for 1 year.
> Pipeline A will regenerate its content, and ask A1 and A2 for their content.
> A1 will regenerate its content.
> A2 will serve up its *cached* content.  Why would A2 have to regenerate
> itself?

It doesn't, but since A has to regenerate, your biggest bang for the
buck is in making sure that things that are dependant on A1 and A2 are
only created once.  So if a header needs data from both A1 and A2 then
don't try and create it as a component, create it only at the time it
is needed.

> Urg.  My mental model must be flawed, unless "data component" does not
> include "result of pipeline"  :-{

It does, but you might be trying to optimize the wrong things.

As an aside; check out using Saxon and XSLTC for other performance
improvements and maybe check out using Stylus (or similar) to optimize
your XSLT...

Peter Hunsberger

View raw message