You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by "Halvorson, Loren" <Lo...@firepond.com> on 2002/05/29 19:14:39 UTC

[cache] Is the Cache Taglib working?

We gave the new cache taglib
(http://jakarta.apache.org/taglibs/doc/cache-doc/intro.html
<http://jakarta.apache.org/taglibs/doc/cache-doc/intro.html> ) a try.

While it seems to be accurately caching the body of the tag.  It appear to
still be executing the body code each time the page is retrieved.

For example:

<cache:cache key="time">
	<% long time = System.currentTimeMillis(); String t =
Long.toString(time); 
		System.out.println("Time: " + t);
	%>
	Time: <%= t %>
</cache:cache>

I would expect the same time to be displayed when I hit refresh in the
browser and it is.  I would also only expect the time to be printed to the
console once (at least until the cache times out).  However, it is printed
each time I hit refresh in the browser.

Are we misunderstanding how it is supposed to work?

Thanks

Re: [cache] Is the Cache Taglib working?

Posted by Shawn Bayern <ba...@essentially.net>.
Loren,

Thanks for the report.  Indeed, this is a (somewhat embarrassing!) bug.  
I've fixed it in the main CVS archive.  If you could test it and let me
know whether it now works the way you expect, that would be wonderful.

Thanks again,

-- 
Shawn Bayern
"JSP Standard Tag Library"   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)

On Wed, 29 May 2002, Halvorson, Loren wrote:

> We gave the new cache taglib
> (http://jakarta.apache.org/taglibs/doc/cache-doc/intro.html
> <http://jakarta.apache.org/taglibs/doc/cache-doc/intro.html> ) a try.
> 
> While it seems to be accurately caching the body of the tag.  It appear to
> still be executing the body code each time the page is retrieved.
> 
> For example:
> 
> <cache:cache key="time">
> 	<% long time = System.currentTimeMillis(); String t =
> Long.toString(time); 
> 		System.out.println("Time: " + t);
> 	%>
> 	Time: <%= t %>
> </cache:cache>
> 
> I would expect the same time to be displayed when I hit refresh in the
> browser and it is.  I would also only expect the time to be printed to the
> console once (at least until the cache times out).  However, it is printed
> each time I hit refresh in the browser.
> 
> Are we misunderstanding how it is supposed to work?
> 
> Thanks
> 


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