You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Gabriel Sidler <si...@teamup.ch> on 2002/07/09 01:00:06 UTC

Re: Custom Directive Arguments?

Rick,
I'd really like to see some caching support in Velocity. This would
be a very valuable add-on.
My approach in the past has been to cache in the model instead of in the
view. But, for many application cases this is really a pain. It makes the
interface between model and view more complicated than necessary and
introduces unnessessary dependencies. My experience is that caching of
complex view snippets can lead to impressive performance improvements.

I'd just like to encourage you to push on with this and share your results
with the community.

Gabe




Rick Gibbs wrote:

> I had a quick question about directives and acceptable usage of them.
> Currently OpenSymphony has a wonderful jsp taglib for caching dynamic
> content. (http://www.opensymphony.com/oscache/) An example of the tag is as
> follows:
> 
> <cache:cache key="foobar" scope="session" time="1800">
>      ... some jsp content ...
> </cache:cache>
> 
> Since we are an anti-jsp shop, and have been working with Velocity over the
> last year, I wanted to see if I could port their caching architecture over
> to a velocity directive:
> 
> #cache( ... )
>     ... some velocity code ...
> #end
> 
> After a couple tests and examples, I am begining to think this won't be too
> hard to achieve.  My question is, there are a variable number of arguments
> to this directive each haveing their own values.  Would it be considered bad
> form to implement something like the following:
> 
> #cache( "key=foobar" "scope=session" "time=1800" )
>     ... some velocity code ...
> #end
> 
> This would allow me to loop over the arguments of directive and set up the
> cache's properties.
> 
> Do you guys think that this the best approach or is there a better way to
> handle this type of "property-setting"
> 
> Thanks for the help,
> 
>     Rick
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> .
> 
> 


-- 
--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Custom Directive Arguments?

Posted by Jon Scott Stevens <jo...@latchkey.com>.
on 7/8/02 4:00 PM, "Gabriel Sidler" <si...@teamup.ch> wrote:

> My experience is that caching of
> complex view snippets can lead to impressive performance improvements.

#macro

-jon


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>