permaculture playing cards
The moose likes Other Java Products and Servers and the fly likes jsp caching and result caching in iAS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "jsp caching and result caching in iAS" Watch "jsp caching and result caching in iAS" New topic

jsp caching and result caching in iAS

sridhar satuloori
Ranch Hand

Joined: Nov 05, 2001
Posts: 144
How can i cache a JSP in iAS? can i explicitly configure iAS for result caching
David Ogren
Ranch Hand

Joined: Jul 19, 2002
Posts: 66
There are two distinct types of caching available in iAS: result caching and JSP caching.
Result caching is a mechanism where the KXS process keeps a cache of request results, if another request comes in with the same parameters the KXS returns the cached results without even passing the request into the JVM. (You can also tune which parameters are used to indicate a "match", how long before a cached item is discarded as stale, and how big the cache should be.)
To configure result caching for a JSP, you need to add a <caching> subelement to the deployment descriptor for that JSP in the ias-web.xml deployment descriptor. The exact details of the XML DTD are here
JSP caching actually happens in the JVM, and that allows for subsections of the JSP to be cached. (Part of a JSP could be cached and another part regenerated with every request.)
To use JSP caching, you utilize the iAS caching taglib. You enclose the part of the page to be cached with <cachelib:cache> tags (where cachelib is mapped to CacheLib.tld). You then use <cachelib:param>, <cachelib:criteria>, and <cachelib:check> tags to definate the cache criteria. Cachelib param defines simple "if these parameters match, use the cache" rules. If you need something more sophisticated, Cachelib check defines a Java class that is called to determine whether the cache should be used. (The Java class must support a simple interface that allows it to be use the request information to make a determination.) And cachelib criteria defines the cache timeout.
I actually wrote the JSP and result caching samples that are shipped with the application server. You can find the documentation for those samples here. They should be under $IAS_ROOT/ias/ias-samples/caching , if you have a server instance available.

[edited by Mike C to dispose of the smilie]
[ September 04, 2002: Message edited by: Mike Curwen ]

David F. Ogren
Author of iAS : Designing and Building J2EE Solutions
sridhar satuloori
Ranch Hand

Joined: Nov 05, 2001
Posts: 144
thanks David,
I agree. Here's the link:
subject: jsp caching and result caching in iAS
It's not a secret anymore!