You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lionel Crine <cr...@4dconcept.fr> on 2004/06/08 13:24:01 UTC

Caching pipelines

Hi,

I'd like to cache A pipeline, where can i find documentation implementing that.

Thanks.


Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


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


Re: Caching pipelines

Posted by Jorg Heymans <jh...@domek.be>.
I created a caching requestgenerator for example that would only cache 
based upon certain requestparameters. Following logic was used
(cocoon 2.0.x but should apply roughly to 2.1 as well), hope it helps 
your understanding


public long generateKey() {

         StringBuffer cacheKey = new StringBuffer();
         Request request = ObjectModelHelper.getRequest(objectModel);
         cacheKey.append(request.getRequestURI());

         Enumeration parameterNames = request.getParameterNames();

         while (parameterNames.hasMoreElements()) {
             String parameterName = (String)parameterNames.nextElement();
             String[] values = request.getParameterValues(parameterName);
             cacheKey.append(parameterName);

                 for (int i = 0; i < values.length; i++) {
                     cacheKey.append(values[i]);
                 }
             }
         }

         long key = HashUtil.hash(cacheKey);
         logger.debug("cachekey is: " + Long.toString(key));
         this.timestamp = key;
         return HashUtil.hash(cacheKey);
     }

public CacheValidity generateValidity() {

	//always cache
        return NOPCacheValidity.CACHE_VALIDITY;
}

HTH
Jorg

Lionel Crine wrote:

> THanks.
> 
> But how can I implements caching into my own transformer ?
> What would be the best to generate the key and to create the validity ?
> 
> I took example from FileGenerator. I hope it will be enough to set the 
> validity.
> I'll make some tests.
> 
> Lionel
> 
> 
> 
> 
> 
> 
> At 14:52 08/06/2004 +0200, you wrote:
> 
>> In 2.0.x you need to make sure that the components your pipeline 
>> consists of implement Cacheable.
>>
>> I believe in 2.1.x it is enough to declare
>> <map:pipeline type="caching">
>> for your pipeline to be cached/cacheable.
>>
>> HTH
>> Jorg
>>
>> Lionel Crine wrote:
>>
>>> Hi,
>>> I'd like to cache A pipeline, where can i find documentation 
>>> implementing that.
>>> Thanks.
>>>
>>> Lionel CRINE
>>> Ingénieur Systèmes documentaires
>>> Société : 4DConcept
>>> 22 rue Etienne de Jouy 78353 JOUY EN JOSAS
>>> Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> Lionel CRINE
> Ingénieur Systèmes documentaires
> Société : 4DConcept
> 22 rue Etienne de Jouy 78353 JOUY EN JOSAS
> Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
> 


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


Re: Caching pipelines

Posted by Lionel Crine <cr...@4dconcept.fr>.
THanks.

But how can I implements caching into my own transformer ?
What would be the best to generate the key and to create the validity ?

I took example from FileGenerator. I hope it will be enough to set the 
validity.
I'll make some tests.

Lionel






At 14:52 08/06/2004 +0200, you wrote:
>In 2.0.x you need to make sure that the components your pipeline consists 
>of implement Cacheable.
>
>I believe in 2.1.x it is enough to declare
><map:pipeline type="caching">
>for your pipeline to be cached/cacheable.
>
>HTH
>Jorg
>
>Lionel Crine wrote:
>
>>Hi,
>>I'd like to cache A pipeline, where can i find documentation implementing 
>>that.
>>Thanks.
>>
>>Lionel CRINE
>>Ingénieur Systèmes documentaires
>>Société : 4DConcept
>>22 rue Etienne de Jouy 78353 JOUY EN JOSAS
>>Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org

Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


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


Re: Caching pipelines

Posted by Jorg Heymans <jh...@domek.be>.
In 2.0.x you need to make sure that the components your pipeline 
consists of implement Cacheable.

I believe in 2.1.x it is enough to declare
<map:pipeline type="caching">
for your pipeline to be cached/cacheable.

HTH
Jorg

Lionel Crine wrote:

> Hi,
> 
> I'd like to cache A pipeline, where can i find documentation 
> implementing that.
> 
> Thanks.
> 
> 
> Lionel CRINE
> Ingénieur Systèmes documentaires
> Société : 4DConcept
> 22 rue Etienne de Jouy 78353 JOUY EN JOSAS
> Tel : 01.34.58.70.70 Fax : 01.39.58.70.70
> 


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