cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylvain.wal...@anyware-tech.com>
Subject Cacheable DirectoryGenerator
Date Tue, 13 May 2003 20:44:36 GMT
Hi folks,

I've updated the DirectoryGenerator so it is cacheable.

The problem of this generator, is that the cache validity cannot be 
known until after generation. So the validity object returned to the 
pipeline is initially just a empty placeholder, and is filled with file 
names and modification dates during the pipeline execution phase. When 
pipeline execution is finished, the produced content goes into the cache 
with a validity object which is correctly filled.

Et voilĂ  ! This technique can be used for others components as well. The 
first that comes to mind is the TraxTransformer to track sources 
included using the document() function.

And to avoid too many calls to the filesystem in search for modified 
files, the DirectoryGenerator has an additional parameter named 
"refreshDelay" which defines the minimum delay between filesystem 
checks. The default is 1 second.

Enjoy,
Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



Mime
View raw message