I'm trying to figure out how to watch for usage of certain context
keys and wondered if anyone had tips.

Our CMS uses templates everywhere, and a very large percentage of the
generated output could be cached based on the 2 timestamps from our
"page" (content) object and the template.  In addition to populating
VelocityContext with data from the content object, I stick in several
keys that would prevent any caching such as $now (new
java.util.Date()).

What I want to do is watch the Velocity merge process and determine
whether the template used $now.  I know I can create an event
cartridge to watch for method usage and reference insertion, but I
don't think either would catch $formatter.formatDate($now), right?

My other idea was to stick some wrapper code/class/cglib manipulation
of the object into the context, or maybe just extend
VelocityContext(), so that if you asked for a certain key, I would
flag this output as not cacheable.

If anyone has feedback on a better approach or potential pitfalls, I'd
be very appreciative.

--
Serge Knystautas
Lokitech >> software . strategy . design >> http://www.lokitech.com
p. 301.656.5501
e. [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to