cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergio Carvalho <scarva...@criticalsoftware.com>
Subject [C2] [Summary] Proposal for caching (repost)
Date Thu, 25 Jan 2001 14:24:33 GMT
(reposted, hopefully now in the correct millenium)

Hi all,

Here's the summary from the ongoing discussion about C2 caching, that ran under the subject
lines of 'caching system idea', 'idle thoughts in caching in c2' and 'Proposal for caching'.


The discussion floated around two main points:
 1) Should cache be explicit on the sitemap? 

I think we all came to agree that an implicit cache is better, but that there are cases where
caching strategy and method can't be decided automatically. The middle ground is obvious:
a default automatic cache should be in place, but two things should be overridable: 

    a) The CacheValidator class, which is responsible for determining if the processing step
is 'dirty'.

    b) The CacheStore class, responsible for storing the generated content. 

Declaration of these overriden classes should be on the sitemap.

 2) Should intermediate steps be cached?

This boils down to answering the question: Can generators get input from sources other than
those declared in the stemap?

I believe the answer is 'yes', generators do get input from sources other than those declared
in the sitemap, so intermediate steps must be cached. 

Nevertheless, some transformers act only on their declared input, and caching their input
is useless (one can cache their output instead). One can only find if this is the case by
asking the transformer itself, so a method for this should be on the Cacheable interface (or
we could distiguish between transformers and translators).

Based on these points, here's a proposal, based on Carsten's:

1. Each cacheable transformer implements a 'Cacheable' interface, which contains the method:
    boolean isDynamic(); // True if transformer acts on inputs not declared on the sitemap
   Dynamic transformers must provide a 
    CacheValidator getCacheValidator();
   method that returns a CacheValidator, responsible for determining if the generator is 'dirty'.

2. Generators are treated like dynamic transformers, with no sitemap-declared input. 

3. Based on the cacheable interface, cache is stored on the input of every non-cacheable or
dynamic transformer.

4. Cache retrieval is done by asking each dynamic component in the pipeline whether it is
'dirty'. If it is dirty, its inputs are retrieved from the cache store, and normal processing
begins.

Thanks Donald, Paul, Giacomo, Stuart and Carsten, for participating (sorry if I missed someone).
Thanks specially to Carsten who wrote the proposal document that is the basis for this summary.

--
Sergio Carvalho
---------------
scarvalho@criticalsoftware.com


-- 
--
Sergio Carvalho
---------------
scarvalho@criticalsoftware.com

If at first you don't succeed, skydiving is not for you

Mime
View raw message