On Fri, 25 Aug 2000, 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.
We'll hash this out ... this is what I was planning for
caching/compiling
After the initial parsing what you are left with is
a Template object that has a body of text with a
series of dynamic content insertion points.
For each one of those points there will be
a corresponding Object to insert the content
at that point. All these object might implement
an insertContent() or something like that.
So there is the content body, and a series of
content inserters.
And I have plans to try and "flatten" as much
as possible, for example if I see something like
#set $foo = "bar"
Then I know that because the RHS is a string literal
it will never change. The same goes with methods
with string literal parameters:
$object.method("param1", "param2");
Somewhere in the content insertion object I will
have a container for a Method object with the
parameters "param1" and "param2" stored.
I'd like to try and detect as much staticity as
possible, and what remains will always have to
refreshed.
So stick the Template object in the GlobalCache,
then nab the content out of Template object and
pass through content insertion points plugging
in the required content.
I would like to add options to Velocity where
you can mark things as static/cacheable so that
it would be possible to have near static content
serving if desired.
jvz.
--
Jason van Zyl
[EMAIL PROTECTED]
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]