cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <>
Subject RE: [SOLUTION] Localization(i18n), session and Caching
Date Fri, 01 Sep 2006 13:03:52 GMT

> Hi all,
> Thanks to all that helped me in the right way especially Ard 
> Schrijvers. I
> managed to solve my problem with caching, I18n Transformer 
> and the session
> locale.
> The i18n transformer is cacheable and so the cocoon cached 
> response is not
> always updated when using the LocaleAction.
> I choose the following path : 
> - I created a simple Action to change the Locale : it 
> analyses the request
> or the session and store the locale in the session and return a map
> containing the session locale.
> - I created a I18nTransformer which is not cacheable based on 
> the existing
> I18nTransformer. I could have looked at the sourceValidity I 
> think but I
> am not sure.

Don't think the problem is in there. The I18nTransformer return a NOPValidity, which just
means: I am valid, no matter what [1].

> I would have like to create a SourceValidity 
> which look for
> the locale in the session. If i have enough time I will give it a try.
> My web site now behaves correctly with a caching pipeline. Everything
> cacheable is cached except the I18nTransformer.

Good to hear! Since you now have already your own I18nTransformer version, you could try to
fix the following for your case: I think for some reason, this part in the I18nTransformer,

     * Implemenation of CacheableProcessingComponents.
     * Generates unique key for the current locale.
    public getKey() {

did not create unique keys for you for different locales. So, every locale ended up in the
same cachekey (you can verify this with the statusgenerator). If you still want to fix it,
and make the I18n cacheable, you should make sure that different locales end up in a different

Regards Ard


> PS: I needed to have authentication too. A simple way was to provide a
> custom authentication was to create an action and use the redirector.
> Thanks again everybody
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message