cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: JXTG and caching
Date Wed, 02 Jun 2004 07:51:34 GMT
Replying myself :)

Leszek Gawron wrote:
> It would have to look somewhat like this:
> function showData() {
>   var validityKey = "request-param:a!!spacer!!request-param:b";
>   var pipeline = "view/someview.jx"
>   if ( someCacheManager.isValid( pipeline, validityKey ) ) {
>     // hope the cache entry does not expire between isValid and page
>     // generation
>     var dummyBizData = {};
>     cocoon.sendPage( "view/someview.jx", dummyBizData );
>     return;
>   }
> 
>   // the page is not cached
>   // do the heavy processing here and send new page
>   var bizData = {};
>   bizData[ "pageData" ] = fetchBizDataByHeavyDBRetrieval();
>   var validity = cocoon.createObject( DBViewValidity );
>   bizData[ "cacheingInfo" ] = validity;
>   cocoon.sendPage( "view/someview.jx",
>                    bizData,
>                    function() {
>                      cocoon.releaseObject( validity );
>                    } );
> }
> 
> It does not look like SoC.
It does not look like it is possible to implement either if you take 
aggregated views into account - one part of the view might need rendering 
because it expired while other could still be fetched from cache. Controller 
would have to know what parts is the view build of and generate appropriate 
data which breaks SoC completely.

The conclusion is: the only way we can generate a cached view is to use some 
technlogogy that "pulls" data (like a java generator or XSP). While xsp is not 
considered a good practise nowadays it needs a replacement fast.

JXTG could be made cacheable for simple cases - ones that do not need heavy 
bizData preparation. Still JXTG gets data pushed into which needs prior data 
retrieval. In cases when data preparation is much more resource consuming than 
view rendering caching hardly makes sense.

-- 
Leszek Gawron                                      lgawron@mobilebox.pl

Mime
View raw message