cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: Using getTransfomerValidity with a source based key for cache invalidating
Date Wed, 10 Mar 2004 20:23:40 GMT
On 12.02.2004 10:39, Corin Moss wrote:

> Hi Guys,
> 
> I've been implementing the external cache validity functionality of
> DBPrism, and I've decided that I want to externally invalidate my
> transformers as well.  I can see that getValidity within (for example)
> TraxTransformer will be fairly easy to implement with an external
> validity, but what I'd also like to do is create a key based on values
> contained within the input source for the transformation.   In this case
> a series of record ids.  I can't rely on a hash, as I need to be able to
> selectively clear the cache given a single valid id.
> 
> As far as I can tell, TraxTranformer's getKey method uses the URI of the
> inputSource as the basis for a key (including params of course.)  Has
> anyone tried modifying this to analyse the _content_ of the input
> document? And if you have, do you have any tips for me?  I have a
> horrible feeling that the performance cost of analysing the input
> document is going to be greater than the gains ;)  I can easily write
> some xpath to concatenate all record ids within an input document, and
> then clear the cache based on any one of those ideas, but I'm sure
> there's a smarter idea :)
> 
> I'd appreciate any feedback you may have.

Hello Corin,

the transformer's cache validity should only depend on the transformer, 
so for the TraxTransformer only on the XSLT. The validity for the input 
document shall be tested in the generator step. At the moment the file 
generator tests only for "last modified", but I guess you can also 
implement your content test. If the input document changes the validity 
of the generator step is invalidated and so the cache of the complete 
pipeline. There is no need for additionally checking the input document 
in the transformer step.

Joerg

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


Mime
View raw message