cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: Is Cocoon2 caching implemented?
Date Mon, 14 Aug 2000 20:48:26 GMT
Hans Ulrich Niedermann wrote:
> Hi all,
> just some more or less random thoughts about caching.
> Disclaimer: I still have to think this through completely and this
> also probably affects the Sitemap -> Pipeline code rendering. I don't
> know much about the Sitemap, Pipelines and Caching.
> "Stevenson, Chris (SSABSA)" <> writes:
> [ XSLT-specific caching internals/proposals deleted ]
> > What about adding behaviours like
> >
> > getLastModified()
> > getWhenExpires()
> >
> > to each pipeline component, that returns a null by
> > default, then have the sitemap work out max()
> > by calling each in turn?
> Sounds good to me. I've thought about caching during the last few
> weeks (without having a look into existing caching code) and came up
> with a similar method but that didn't go that far.
> However, the getLastModified() and getWhenExpires() methods probably
> have to know about request parameters (URI params, Post stuff,
> cookies, sessions etc.) to determine if the output data has changed.

Agreed. What about

 long getLastModified(Enviornment env);
 long getWhenExpires(Enviornment env);

> > This makes more sense to me because the idea of
> > modification time belongs on the component
> > (be it generator, filter or serializer) and
> > not at the sitemap level...
> >
> > For example, suppose there is a filter that uses
> > some time-based criteria to change the way it
> > generates a file (maybe black bg for evening,
> > yellow for daytime). No files change, but the
> > last-modified *does* change.
> >
> > This could also be used to abstract out the
> > re-compilation and caching tests - you just call
> > getLastModified() on each pipeline component,
> > and if it is later than the cached version,
> > mark the pipeline as dirty.
> And this even lets us write a cache engine that caches intermediate
> data, i.e. the possibly expensive first parts of the pipeline that
> depend only on seldomly changed data are only seldomly called.
> But this suggests adding a third method to all pipeline components
> that tells the cache engine if caching results makes any sense at all
> (imagine a component that outputs the current time).

Hmmm, even better, what if we have an inteface

 public interface Cacheable {
   long getLastModified();
   long getWhenExpires();

that components implement when they will benefit from caching? 

(then the pipelines can do (instanceof(Cacheable)) to see if they should
use the cache or not).

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

View raw message