cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <>
Subject Re: [FIX] I18nTransformer [CACHING PIPELINE]
Date Sat, 09 Sep 2006 22:56:59 GMT
Yves Zoundi wrote:
>  The issue with the i18ntransformer is that generated cache keys are not
> unique. A simple solution which might not be the best is: 
> public class I18nTransformerFix extends I18nTransformer {    
>     public Serializable getKey() {
>         StringBuffer buff = new StringBuffer();
> 	buff.append("" + System.currentTimeMillis());
> 	buff.append("_");
> 	buff.append(super.getKey());
>         return buff.toString();
>     }
> }

Whoa... using the current time in the cache key pretty much guarantees 
that two calls of getKey() will never return the same value, and 
therefore you'll never get a cache hit.  This renders caching completely 
useless, it's just as if the I18nTransformer were not cacheable at all!

I still don't see why you're having problems to begin with.  As long as 
the locale is correctly used to build the cache key everything should be 
fine and dandy.  If something's going wrong with that then I think a 
real fix needs to be found rather than adding extra junk to the cache key.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message