Jim Emerson wrote:
Hi All,

I'd like an example of how to cache an xml file in a pipeline, I haven't found any examples online, the documentation helped a little but didn't explain how to do it.

I have this in my sitemap componenents:

<map:pipes default="caching">
<map:pipe name="caching" src="org.apache.cocoon.components.pipeline.impl.CachingProcessingPipeline"/>


<map:pipe name="caching-point" src="org.apache.cocoon.components.pipeline.impl.CachingPointProcessingPipeline">

<autoCachingPoint>On</autoCachingPoint>
</map:pipe>
<map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline"/>


</map:pipes>

And this is my pipeline:

<map:pipeline type="caching">
<map:match pattern="xsl-display-story">
<map:generate src="{defaults:story-path}{request-param:storyid}.xml"/>
<map:transform src="{defaults:xsl-path}{request-param:gateway}_displaystory.xsl"/>
<map:parameter name="servletPath" value="{request:servletPath}"/>
<map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
<map:parameter name="contextPath" value="{request:contextPath}"/>
<map:parameter name="wwwroot" value="{defaults:www-root}"/>
<map:parameter name="docid" value="{request-param:storyid}"/>
<map:parameter name="monthdir" value="{request-param:monthdir}"/>
<map:parameter name="regname" value="{request-param:regname}"/>
<map:parameter name="regionsfile" value="{defaults:regions-file}"/>
<map:parameter name="gateway" value="{request-param:gateway}"/>
<map:serialize type="html"/>
</map:match>
</map:pipeline>


I need to cache the entire transformation, and only run it again if the xml file has been updated.

It is aready cached automagically from what I can see for each unique combination of parameters. If you still have the samples running, you can see what is cached by going to the /status sample page. You will probably also see a difference in response time after the first request.


Geoff

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to