cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Unico Hommes <un...@hippo.nl>
Subject Re: Caching JXTemplate
Date Tue, 06 Jul 2004 10:04:46 GMT
Leszek Gawron wrote:

> Unico Hommes wrote:
>
>> Unico Hommes wrote:
>>
>>> I am carrying this over to dev@ so other developers can comment.
>>>
>>> Leszek Gawron wrote:
>>>
>>>> Unico Hommes wrote:
>>>>
>>
>> <snip/>
>>
>>>>>
>>>>> Oh but I think I see now. The cache-key and cache-validity objects 
>>>>> are associated with the compiled template object using template 
>>>>> properties. The compiled template in turn is cached directly by 
>>>>> the generator using the validity of the src of the generator. That 
>>>>> should work.
>>>>>
>>>>> So now how to use this feature. If I read this correctly cache-key 
>>>>> and cache-validity attributes can be specified on an element 
>>>>> anywhere in the xml:
>>>>>
>>>>> <element jx:cache-key="${cacheKeyExpression}" 
>>>>> jx:cache-validity="${cacheValidityExpression}" />
>>>>
>>>>
>>>>
>>>>
>>>> Yes it is. I am thinking about a slight change. Right now every xml 
>>>> node is parsed for jx:* attributes. What I would like to do is to 
>>>> introduce
>>>> <jx:processing instruction name="cache-key" value="${expr}"/>
>>>> wdyt?
>>>>
>>>
>>> Yes, I agree it would be better not to check each element for these 
>>> attributes. <jx:processing-instruction/> sounds like a good option 
>>> to me.
>>>
>>
>> There is one other thing. The cache key that is returned by 
>> JXTemplateGenerator should be the src + jx:cache-key attribute value. 
>> Since the jx:cache-key is only a hash of the objects that are used in 
>> the template. These could, in theory, be the same as those objects 
>> used by another template. Therefore it is neccessary to also qualify 
>> the cache key with location of the template.
>
> I think it is ok right now from what I saw in sitemap.log the src is 
> combined with cache key by cocoon itself (same as for XSP)
>

Actually, in my log it says:

processXMLPipeline: caching content for further requests of 'bar' using 
key PK_G-jx-theKey_S-xml-1
Found cached response for 'bar' using key: PK_G-jx-theKey_S-xml-1

It should be more like PK_G-jx-file://blah/template.xml-theKey_S-xml-1

I'm already working on it.

--
Unico

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message