Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

OSCache tag library

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
populated
Console:
" Created new session-scoped cache in session
94FFF4FAE818657D63DFD96049A9A99A at key: __oscache_cache"


In oscache.properties file
cache.use.host.domain.in.key=true
cache.path=c:\\myapp\\cache
cache.algorithm=com.opensymphony.oscache.base.algorithm.FIFOCache
cache.blocking=false
cache.capacity=1000
cache.unlimited.disk=false
The rest properties are commented out


In the JSP
<%@ taglib uri="http://www.opensymphony.com/oscache" prefix="cache" %>
<cache:cache scope="session">
...jsp content here...
</cache:cache>


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?
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Where is your code for fetching records from database? Is it the same JSP page where you are populating records and caching?
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!