cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From José Ignacio París Prieto <jpa...@sadiel.es>
Subject Re: CInclude caching in pipelines
Date Wed, 19 May 2004 10:32:37 GMT
Sorry for my misunderstanding :), but ...
does it means that the CInclude transformer isn't aware of changes of the
included sources, and, consecuently, it doesn't report those changes to the
pipeline component, returning the cached contents despite they are obsolete?
If it does so, it means that the cinclude cache only refreshes when the
expires period is over. is that ok?
In that case, i'd like to implement a cinclude-cache mechanism that is aware
of modifications of the included sources. I suspect that IncludeCacheManager
and Source have something to do there. Could anybody give me a clue?
Thanks

----- Original Message ----- 
From: "Carsten Ziegeler" <cziegeler@s-und-n.de>
To: <dev@cocoon.apache.org>
Sent: Wednesday, May 19, 2004 10:58 AM
Subject: RE: CInclude caching in pipelines


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.

HTH
Carsten

Carsten Ziegeler
Open Source Group, S&N AG
http://www.osoco.net/weblogs/rael/
> 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
>


Mime
View raw message