cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hannes Haug <>
Subject don't cache - compile
Date Wed, 26 Jan 2000 11:11:48 GMT
Let's assume that processing chains are a matter of
configuration (i. e. they are not built at request
time) and all processing stages are xslt (possibly
with extensions). Then it should be possible to
compile the whole chain to a processor. This would
allow inter stylesheet optimizations. We would loose
the need for caching intermediate documents - there
are none. We would also loose the need for an api
between processing stages.

Do we have to cache the output documents of processors?
I don't think so. The output documents of formatters
depend only on the input documents. So let's cache the
final document. Or better: don't cache - validate.

Now let's have a look at producers. What are the
origins of documents? Ordinary xml files and stand
alone xslt files (possibly with extensions). The xslt
files should be compiled to producers. We can even
compile the xml files to producers. Should we cache
the output documents of producers? The producers are
the cache of the documents.

Another possibility are configured producers (one
producer and serveral processing stages).

Now let's look at cache validation. The output of
a processors can depend on the input document (if
it doesn't it's really a producer) or on some
external thing like db (in this case the result
should not be cachable). The output of producers
can depend on the servlet request or some external
thing. The output of producers of ordinary xml files
is constant. All this validity checking can be done
w/o file system access.

The validity of the internal state of processors
and producers is another thing. Here the files that
define the components come into play. And this
validity doesn't have to be checked for every request.
One possibility would be a background thread that
does the update. Another possibility is to have
something like "last change" and "last checked"
variables in the components. If request time >
last checked + n seconds then there has to be
checked if the component has to be updated and
last changed has to be set. Finally, last checked
has to be set. If you really need up to date
components you can configure n=0. But most of the
time something like n=300 shouldn't be a problem.


View raw message