Jon Stevens wrote:
> 
> on 8/25/2000 3:38 PM, "dave" <[EMAIL PROTECTED]> wrote:
> 
> > I 'm working on the FileTemplateLoader for Velocity tonight.  I planned on
> > using a caching mechanism within the loader that works similar to the way a
> > web server loads files.  The caching mechanism will keep a last modified
> > stamp on the file and reload as necessary.  I need this before I start the
> > service stuff.
> >
> > How's this sound?
> 
> 0.
> 
> We want to be able to expand the whole process to include compiled templates
> that have been pre-parsed (somehow, you need to get a reference to the AST
> tree). The way that I was envisioning this to work is essentially a
> serialized byte[] of an object to disk as being the compiled version. So,
> what I would like is for this caching service to wrap each template into an
> object that can be serialized and then the internal code within Velocity
> should read this object from memory or get it from disk.
> 
> did that make any sense? :-)

Of course...it's the AST node structure that needs to be serialized. 
But how expensive will the serialization/deserialization be?  It might
be overkill for only shallowly nested templates, or templates with only
a single token in them.  Perhaps the AST node data (i.e. the "compiled"
template) should only be written to disk if it hasn't been used for a
given period of time.  This would reduce disk I/O by keeping the
compiled template around in memory for awhile.
-- 

Daniel Rall <[EMAIL PROTECTED]>


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to