cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <lgaw...@mobilebox.pl>
Subject Re: Caching jx *without* flow
Date Mon, 18 Sep 2006 15:19:22 GMT
Niels van Kampenhout wrote:
>> We could probably add this class to cocoon-template block and provide 
>> some samples. Still - nothing needs to be changed.
>>
> 
> I must admit that I don't know much about JXTG from a developer's 
> p.o.v., but from a user's p.o.v. (building web sites) our 
> HippoJXTemplateGenerator [1] has been a huge improvement over the JXTG. 
> But then, maybe JXTG has features that I don't know about which could 
> make life easier without the modifications in [1]. I can't find them in 
> the documentation [2,3] however. I guess I need to dive into the code 
> for that ;-)
> 
> Thanks,
> Niels
> 
> [1] 
> http://svn.hippocms.org/repos/hippo/hippo-cocoon-extensions/trunk/hippo-misc/src/java/nl/hippo/cocoon/generation/HippoJXTemplateGenerator.java

> 
> [2] http://cocoon.apache.org/2.1/userdocs/jx-generator.html
> [3] http://wiki.apache.org/cocoon/JXTemplateGenerator

Please update your cocoon checkout to the latest trunk. Then build 
cocoon-webapp, run it and point your browser to: 
http://localhost:8888/blocks/cocoon-template-sample/view/caching3

The template header is:

<page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" 
jx:cache-key="${cocoon.request.parameters.toString()}" 
jx:cache-validity="${Packages.org.apache.excalibur.source.impl.validity.NOPValidity()}">

you probably may do the same with 
jx:cache-key="${cocoon.parameters.toString()}" which will automatically 
build up cache-key out of all cocoon parameters passed to the template. 
Haven't tested it though. This means you probably don't even need any 
additional code to achieve your goals.

The only thing that's missing from HippoJXTemplateGenerator.java 
functionality is the ability to exclude some parameters from cache key. 
Anyway this looks like FS from the start:
  - if template makes use of all cocoon parameters they should be a part
    of the cache key,
  - if not - you shouldn't pass them instead of excluding.

Please comment.


-- 
Leszek Gawron, IT Manager                          MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Mime
View raw message