cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craeg Strong <>
Subject Re: Pattern for use of sub-pipelines to grab content at different stages?
Date Wed, 24 May 2006 14:55:26 GMT

Thanks for the informative reply!

Peter Hunsberger wrote:
> On 5/24/06, Craeg Strong <> wrote:
>> I want to assemble a web page the way a factory assembles a car.
>> That is, I want to assemble a transmission, and set it aside (cache my
>> header/footer)
>> I want to assemble a chassis, and set it aside (cache my user-specific
>> menu bar)
>> Then I want to include the transmission, chassis, and frame into the
>> final car (document).
> One question; why do you want to do this?
I am trying to test a solution pattern that is probably a bit of 
overkill for my immediate first use of cocoon.
However my master plan is to replace Struts with Cocoon in a massive 
J2EE application.
The application supports the custom display requirements of 150 
different labor unions so it is really more like a product line than a 
In order to scale properly, we have to cache at multiple levels.
Since we make such heavy use of XSLT in order to generate DHTML pages, 
minimizing the amount of XSLT processing is of primary importance.
Page weight is of concern, since our application is highly interactive 
with lots of iframe overlays, AJAX, etc.
But a significant portion of the overall page weight for each page does 
not actually change on a page by page basis (e.g. navigation menus, etc) 
-- but rather per user session.
This is what I want to cache. 
I guess the session must be used as a caching key.
>> All the examples I have seen to date that use xinclude and aggregators
>> don't seem to support caching intermediate products.
> Aggregators don't directly have anything to do with the cache, it's up
> to the pipelines that feed the aggregators to manage what is
> cacheable.
Ah! I believe the key phrase there was "pipelines that feed the 
aggregators", right?  [lightbulbTurnsOn]

The examples I have seen have only aggregated simple generators:

<map:aggregate element="sum">
     <map:part src="docs/login.xsp" />
     <map:part src="docs/config.xml" element="userprofile"/>

But if instead I am aggregating the output of sub-pipelines, then at 
least some of the sub-pipelines may be cached.

   <map:part src="cocoon:/headerFooter"/>
    <map:part src="cocoon:/body"/>

The output of the headerFooter sub-pipeline might be something like this:
     ..footer ,copyright, etc.

I suppose normally such a page-skeleton would be generated via a simple 

I am just going up one level of complexity from XSP to [ XML "template" 
+ XML "data generated from Java" + XSLT ]

It sounds like all of this is doable in Cocoon. 

I just have to make sure that each of the generators in the cacheable 
sub-pipeline is itself cacheable and generates the session id as a 
caching key.

Am I on the right track?


View raw message