This element maps a URL pattern or a servlet name to its cacheability constraints.
The following table describes subelements for the cache-mapping element.
Table A–36 cache-mapping Subelements| 
 Element  | 
 Required  | 
 Description  | 
|---|---|---|
| 
 requires one servlet-name or url-pattern  | 
 Contains the name of a servlet.  | 
|
| 
 requires one servlet-name or url-pattern  | 
 Contains a servlet URL pattern for which caching is enabled.  | 
|
| 
 required if timeout, refresh-field,http-method, key-field, and constraint-field are not used  | 
 Contains the name of the cache-helper used by the parent cache-mapping element.  | 
|
| 
 zero or more  | 
 Specifies the RequestDispatcher methods for which caching is to be enabled on the target resource. Valid values are REQUEST, FORWARD, INCLUDE, and ERROR (default: REQUEST).  | 
|
| 
 zero or one if cache-helper-ref is not used  | 
 Contains the cache-mapping specific maximum amount of time in seconds that an entry can remain in the cache after it is created or refreshed  | 
|
| 
 zero or one if cache-helper-ref is not used  | 
 Specifies a field that gives the application component a programmatic way to refresh a cached entry.  | 
|
| 
 zero or more if cache-helper-ref is not used  | 
 Contains an HTTP method that is eligible for caching.  | 
|
| 
 zero or more if cache-helper-ref is not used  | 
 Specifies a component of the key used to look up and extract cache entries.  | 
|
| 
 zero or more if cache-helper-ref is not used  | 
 Specifies a cacheability constraint for the given url-pattern or servlet-name.  | 
none