cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <>
Subject RE: CInclude caching in pipelines
Date Wed, 19 May 2004 08:58:34 GMT
José Ignacio París Prieto wrote:
> Hello,
> I,ve 2 questions about CInclude and caching:
> - it seems to implement the CacheableProcessingComponent 
> interface, in order to support caching in a pipeline, but, 
> looking through the code, the "getKey" method ALWAYS RETURN 
> "1" for all instances of the component. It's supossed that 
> the key returned must be unique for each different result of 
> the cinclude transformation. is that ok?
> - moreover, this caching support is only activated if the 
> parameter "support-caching" is set to true (look at the setup 
> method), which is not documented.
> Are those true or am I losing something?  

Yes, they are true :)
The caching algorithm checks if a cached response is valid
based on the "input" of a pipeline component. The "input"
of a component are e.g. parameters, the source that is read
etc. But the component can rely on the fact that it always
gets the same XML stream.
So, in other words, the cinclude transformer has the same
behaviour if the same XML comes into the transformer. The
xml contains the same include statements etc. So, that's
why the key is simply "1".
For example, the file generator returns the source it reads
as the key (the uri) because this is the "input" for the generator.
It doesn't get any XML.

Now, caching is only enabled if you set the parameter, yes,
this is because of compatibility and because of ease-of-use.
The caching has been introduced very lately, so if this
would be the default behaviour some users would be surprised
to see now changes even if they change the included sources etc.
And this is of course also useful for highly dynamic includes,
development and testing.


Carsten Ziegeler 
Open Source Group, S&N AG
> I'm pretending to 
> support the "If-modified-since" http header for pipelines. It 
> works for those which CInclude caching activated in that way, 
> but I think that something is wrong with the "1" key. 
> wouldn't be better return the src URI in that method?
> Regards
> Jose

View raw message