We must modify the web.xml file to reference library TAGS:
Code:
<taglib>
<taglib-uri> oscache </ taglib-uri>
<taglib-location> / WEB-INF/oscache.tld </ taglib-location>
</ Taglib>
We also have to play the oscache.properties configuration file and display the contents persistent cache directory.
Code:
# CACHE DIRECTORY # #
This is the directory on disk caches WHERE will be stored by the DiskPersistenceListener.
# It will be created if it does Already exist. Remember That OSCache must-have
# write permission to this directory.
# # Note: for Windows machines, this Needs \ to be escaped # ie Windows:
# cache.path = c: \ \ myapp \ \ cache # or * ix: # cache.path = / opt / myapp / cache
# cache.path = d: \ \ cacheadictos \ \ WEB-INF \ \ cache
Our JSP, refers to a tag library in order to have the game of TAGS to help us in our work:
<% @ Taglib uri = "oscache" prefix = "cache"%>
Declaring an area that we want to cache is as simple as including a block like this:
<Cache: cache key = "Zona1" scope = "application" duration = "10">
Depending on the type of application and scope of the cache element can play with different modifiers: key, scope and duration (see the documentation for more details and other related labels). We have specified that we want all users have this cached content and every 10 seconds to cool.
Bookmarks