cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: [COCOON3] XSLTTransformer optimization and reusability
Date Sat, 25 Oct 2008 16:22:26 GMT
Simone Tripodi wrote:
> Hi Reinhard,
> I'm sorry I was not very clear, as "reloader" I mean a sort of XSLT
> watchdog that reload it when it's changed - it's a feature already
> present in oldest Cocoon's version, Sylvain spoke about it in the Jira
> issue
>   

There are two ways you can consider to reload stylesheets: check if it's 
up to date when it is used, and reload if necessary, or have a 
background watchdog that triggers reload.

The first solution is the simplest one to implement, but has two drawbacks:

- the first user request that uses the modified stylesheet pays the cost 
of reloading. Probably not an issue in production systems though, since 
XSLTs are not supposed to change often and are usually fast to load.

- on a busy system, it puts a high load on the filesystem to check if 
the file has changed. This is solved by ensuring the file is checked 
only once for a given period of time (e.g. 1 second) regardless of the 
number of uses of the stylesheet that happen during this period. This is 
achieved by using a DelayedValidity object that wraps the actual source 
validity.

Sylvain

[1] 
http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/validity/DelayedValidity.java

-- 
Sylvain Wallez - http://bluxte.net


Mime
View raw message