cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: new PDF caching sample - unable to get caching to work
Date Fri, 02 May 2003 08:28:19 GMT
Bertrand Delacretaz wrote:
> 
> I'm unable to get caching to work in a sample that I just added to the  
> FOP block (under src/blocks/fop/samples/).
> 
> Problem: the Generator output is cached correctly but FOP is called  
> every time to convert the XSL-FO to PDF.
> 
> What I'm trying to do is to have Cocoon cache the generated PDF to  
> avoid calling FOP again if the Generator says that the data is sill  
> valid.
> 
> Here's the pipeline (full sitemap is in CVS):
> 
> <map:pipeline type="caching">
> ...
>              <!-- reuse the XSP caching example for our caching test -->
>              <map:match pattern="cache-test-*-*-*.pdf">
>                  <map:generate  
> src="cocoon://samples/xsp/java/ 
> cacheable?pageKey={1}&amp;other={2}&amp;validity=30"/>
>                  <map:transform src="cache-test/xsp-sample-to-fo.xsl">
>                      <map:parameter name="pages" value="{3}"/>
>                  </map:transform>
>                  <map:serialize type="fo2pdf"/>
>              </map:match>
> 
> </map:pipeline>
> 
> Am I doing something wrong?
Can you see, that the output of the generator is cached?
It seems that your stylesheet transformation prevents the caching,
which means that the transformer might get a different key/validity
each time it is used.

For caching the sitemap components are asked one after the other
if they support caching, so if the transformer is not cacheable
your serializer is never called.

> I read about the caching-point pipeline but IIUC it shouldn't be needed  
> in this case.
> 
No, the caching-point does not help, as it can only cache at further
steps in the pipeline, e.g. the output of the generator etc.

Carsten

Mime
View raw message