cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Quenot <>
Subject Problem with CachingPointProcessingPipeline
Date Tue, 20 Dec 2005 15:56:57 GMT

Sylvain pointed me to  the CachingPointProcessingPipeline to avoid
recomputing the whole pipeline when  the generator is still valid.
I noticed that CachingPointProcessingPipeline was storing the long
key (G+T), and the short key as well (G).  Great!

Then  I tried  to  invoke the  pipeline with  only  a few  changes
to  the  parameters  of  the  transformer,  I  would  then  expect
that  the generator  result is  taken from  cache, but  it is  not
the case.  Instead,  CachingPointProcessingPipeline recomputes the
whole pipeline, stores  the long key (G+T) because  T has changed,
but it stores again the short  key (G) whose parameters stayed the

It looks like  the short key is  never tried when the  long key is
not available.  I noticed  a parameter called « smart-caching » in
AbstractCachingProcessingPipeline.  When  I set this  parameter to
« false », the generator  result is taken from cache.   Here is an
excerpt of the code:

                if (!this.doSmartCaching) {
                    // try a shorter key
                    if (this.fromCacheKey.size() > 1) {
                        if (!this.completeResponseIsCached) {
                        finished = false;
                    } else {
                        this.fromCacheKey = null;
                } else {
                    // stop on longest key for smart caching
                    this.fromCacheKey = null;

Notice  that  by default,  we  « stop  on  longest key  for  smart
caching » instead of « try a shorter  key ».  Any idea what is the
meaning of this doSmartCaching parameter?

I would expect  this parameter defaulting to  « false » instead of
« true » for backwards compatibility,  and to invert the behaviour
of  AbstractCachingProcessingPipeline to  try the  short key  when
« smart-caching » is set.  Then I have to set « smart-caching » to
« true »  in  the  caching-point component  configuration  in  the
sitemap to try  the short key when the long  key is not available.
See patch attached.

Jean-Baptiste Quenot
Systèmes d'Information
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46

View raw message