Configures caching for web application components.
sun-web-app (sun-web.xml)
The following table describes subelements for the cache element.
Table A–9 cache Subelements| Element | Required | Description | 
|---|---|---|
| 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. | 
The following table describes attributes for the cache element.
Table A–10 cache Attributes| Attribute | Default | Description | 
|---|---|---|
| 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. | 
The following table describes properties for the cache element.
Table A–11 cache Properties| Property | Default | Description | 
|---|---|---|
| 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. | 
The following table lists possible values of the cacheClassName property.
Table A–12 cacheClassName Values| Value | Description | 
|---|---|
| A bounded cache with an LRU (least recently used) cache replacement policy. | |
| An unbounded cache suitable if the maximum number of entries is known. | |
| A cache suitable for a large number of entries (>4096). Uses the MultiLRUSegmentSize property. | |
| A cache suitable for limiting the cache size by memory rather than number of entries. Uses the MaxSize property. |