How did you implement caching in JSP?
OSCache is an open-source caching library that's available free of charge from theOpenSymphony organization (for more details visit
OSCache - OSCache). OSCache has a set of JSP tags that make it easy to implement page caching in your JSP application.Following are some Cache techniques it fulfills:-Cache entry An object that's stored into a page cache is known as a cache entry. In a JSP application,a cache entry is typically the output of a JSP page, a portion of a JSP page, or a servlet.
218Cache keyA page cache is like a hash table. When you save a cache entry in a page cache, you mustprovide a cache key to identify the cache data. You can use keys like URI, other parameterslike username, ipaddress to indentify cache data.Cache durationThis is the period of time that a cache entry will remain in a page cache before it expires.When a cache entry expires, it's removed from the cache and will be regenerated again.Cache scopeThis defines at what scope the data is stored application or session scope.<os:cache time="60"><%= new java.util.Date().toString() %></p></os:cache>The above tag says that refresh after every 60 seconds the user requests data. So if user1is requesting the page it will display fresh date and if an other user requests with in 60seconds it will show same data. If any other user requests the page after 60 second he willagain see refreshed date.