velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jochen Toppe" <joc...@jtoee.com>
Subject RE: Template Caching
Date Sun, 24 Oct 2004 13:26:34 GMT

I have one veloc engine in my app and have my own resource loader coupled
with the underlying cms's publication mechanism. Invalidation and
reloading of the templates works like a charm. Even w/ the file resource
loader which I also use. Ya must be doing something wrong. Download the
source, hook up a debugger and you'll probably figure it out in 10
minutes. Software is just human, not a mystery :) To avoid browser cache,
CRTL-reload or shift-reload (depending on the browser) will also do the
trick.

Cheers,
  jochen

> Hi,
>
>
> In my application, I used Velocity engine as a separate instance each
> time for evaluating templates, basically non-singlton. I find the
> performance is not that bad.
>
> What I did is that, I created a class called VelocityParser and have it
> encapsulate the VelocityEngine class. Each time I want to render a
> template, I used new VelocityParser().render(...), which in turn, new up a
> VelocityEngine
> object and does the real rendering.
>
> This way, there is no template caching issue. You can even turn on
> template caching and make a singlton class afterwards by doing:
> VelocityParser.newInstance().render(...).
>
>
> Cheers,
>
>
> Jian
>
>
>> ===== Original Message From "Steve O'Hara"
>> <sohara@pivotal-solutions.co.uk>
>>
> =====
>
>> Hi Shinobu,
>>
>>
>> Yeh, it's a mystery..........
>> To check that it definitely wasn't the browser cache, I set an expires
>> header and no-cache control. Also, I switched from IE to Mozilla whilst
>> Tomcat was running and it still
>> showed the cached page. It does show any changed context data, which
>> would also indicate that it isn't a browser issue.
>>
>> I suppose I'm getting to the poitn where I'll need to download the
>> Velocity
>> source and debug it.......?
>>
>> Steve
>>
>>
>>
>> -----Original Message-----
>> From: Shinobu Kawai [mailto:shinobu.kawai@gmail.com]
>> Sent: 23 October 2004 17:38
>> To: Velocity Users List
>> Subject: Re: Template Cacheing
>>
>>
>>
>> Hi Steve,
>>
>>
>>> Thanks for your notes, but I still can't turn the cacheing off.
>>>
>>>
>>> This is my code............
>>>
>>
>> ## snip
>>
>>
>>> What am I doing wrong ?
>>>
>> Hmm.  AFAICS, nothing.  Actually your code worked in my environment.
>> (I use Tomcat 5.5, but that shouldn't matter.)  Even more,
>> FileResourceLoader doesn't cache by default.  Could it be that your
>> browser is caching, and not Velocity?
>>
>> Best regards,
>> -- Shinobu Kawai
>>
>>
>> --
>> Shinobu Kawai <shinobu.kawai@gmail.com>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message