cache
Configures caching for web application components.
Superelements
sun-web-app (sun-web.xml)
Subelements
The following table describes subelements for the cache element.
cache Subelements
|
|
|
|
zero or more |
Specifies a
custom class that implements the CacheHelper interface. |
|
zero or one |
Allows you to change
the properties of the default, built-in cache-helper class. |
|
zero or more |
Specifies a cache
property, which has a name and a value. |
|
zero or more |
Maps a URL
pattern or a servlet name to its cacheability constraints. |
|
Attributes
The following table describes attributes for the cache element.
cache Attributes
|
|
|
|
4096 |
(optional) Specifies the maximum
number of entries the cache can contain. Must be a positive integer. |
|
30 |
(optional) Specifies
the maximum amount of time in seconds that an entry can remain in
the cache after it is created or refreshed. Can be overridden by a
timeout element. |
|
true |
(optional) Determines whether servlet and JSP caching is enabled. |
|
Properties
The following table describes properties for the cache element.
cache Properties
|
|
|
|
com.sun.appserv.web.cache.LruCache |
Specifies the fully qualified
name of the class that implements the cache functionality. See Cache Class Names for possible values. |
|
4096 |
Specifies
the number of entries in a segment of the cache table that should
have its own LRU (least recently used) list. Applicable only if cacheClassName
is set to com.sun.appserv.web.cache.MultiLruCache. |
|
unlimited; Long.MAX_VALUE |
Specifies an upper bound on the cache memory
size in bytes (KB or MB units). Example values are 32 KB or 2 MB. Applicable
only if cacheClassName is set to com.sun.appserv.web.cache.BoundedMultiLruCache. |
|
Cache Class Names
The following table lists possible values of the cacheClassName property.
cacheClassName Values
|
|
com.sun.appserv.web.cache.LruCache |
A bounded cache
with an LRU (least recently used) cache replacement policy. |
com.sun.appserv.web.cache.BaseCache |
An unbounded cache suitable if
the maximum number of entries is known. |
com.sun.appserv.web.cache.MultiLruCache |
A cache suitable for a large
number of entries (>4096). Uses the MultiLRUSegmentSize property. |
com.sun.appserv.web.cache.BoundedMultiLruCache |
A cache suitable for limiting
the cache size by memory rather than number of entries. Uses the MaxSize
property. |
|