cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@sundn.de>
Subject AW: CachingCIncludeTransformer
Date Thu, 05 Jul 2001 08:27:55 GMT
Hi,

with the current caching algorithm implemented in Cocoon2 it is
not possible to cache either the CInludeTransformer nor the
XIncludeTransformer.

Why is this so?

Before the sax stream is generated (before the generator starts
reading its xml document), the caching algorithm builds the
key and collects the validity objects for the current request.

At this stage, the CachingCIncludeTransformer didn't get any
startElement() call, so it does not know which content will
be included at a later time. So the key and the validity
objects cannot contain any information about this.

So the key and your validity objects your transformer generates
are always the same, regardless which documents are included.

Sorry.

Regarding caching in content aggregation:
It is implemented and should work, if you do not aggregate pipelines. If you
aggregate xml files it is cached.
In opposite to the Transformer the content aggregation knows
beforehand which documents are aggregated (or included if you like),
so the key and the validity objects generated contain all this
information.


Carsten

Open Source Group                        sunShine - b:Integrated
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                          mailto: cziegeler@sundn.de
================================================================

>
> Maciek Kaminski wrote:
>
> I am attaching code of CachingCIncludeTransformer,
> IncludeCacheValidity and xml
> files to try it.
>
> Is just a try to attack problem of caching cinclude transformer. Current
> caching framework design hardly makes it possible. One has to use
> CacheValidity
> objects in a hacky way.
>
> As ContentAggregator it caches only if includes are files, since sitemap
> sources always return getLastModified() == 0.
>
> Anyone works on caching sitemap includes in ContentAggregator?
>
> P.S.:
> To try it one should change
>
> <map:transformer
>     name="cinclude"
>     src="org.apache.cocoon.transformation.CIncludeTransformer"/>
>
> to
>
> <map:transformer
>     name="cinclude"
>     src="org.apache.cocoon.transformation.CachingCIncludeTransformer"/>
>
> and add something like:
>
>    <map:match pattern="x.xml">
>      <map:generate src="x.xml"/>
>      <map:transform type="cinclude"/>
>      <map:serialize type="xml"/>
>    </map:match>
>
> to sitemap.xmap and put x.xml, y.xml, z.xml into webapp dir.
>
>
> Maciek Kaminski
> maciejka@tiger.com.pl
>
>


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


Mime
View raw message