This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes OSCache and the fly likes OSCache tag library Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Caching » OSCache
Bookmark "OSCache tag library" Watch "OSCache tag library" New topic

OSCache tag library

N Kriplani
Ranch Hand

Joined: Oct 10, 2005
Posts: 39
I am using Tomcat 5.5 and using OSCache 2.4.1 to improve the
performance of JSP pages.

When a user logs in, records are loaded from the database, but this
takes too long and the browser freezes until all the records load. To
cache this occassionally changing content from second request onwards,
I surrounded the JSP with <cache:cache> tags.

However, if I refresh the page or navigate to another link and come
back, it still seems to go the database and fetch the records! Can't
figure why it does not cache. The cache is apparently created and
" Created new session-scoped cache in session
94FFF4FAE818657D63DFD96049A9A99A at key: __oscache_cache"

In file
The rest properties are commented out

In the JSP
<%@ taglib uri="" prefix="cache" %>
<cache:cache scope="session">
...jsp content here...

I also enabled disk caching and when I see the cache file, it caches
ok! The content appears in the cache file in c:\\myapp\\cache. Don't
understand why it still goes to the database.

Any ideas?
SaurabhSri Sri
Ranch Hand

Joined: May 01, 2008
Posts: 43

Where is your code for fetching records from database? Is it the same JSP page where you are populating records and caching?

SaurabhSri (SCJP 1.5)
I agree. Here's the link:
subject: OSCache tag library
Similar Threads
Tomcat url redirect problem
encoding problem, please help
How to prevent caching of jsp pages?
Spring jQuery form submit request.getSession(false) returns session but with a new session id
Log out Functionality for my Web Application