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: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > . > > -- -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
