The following table describes attributes for the cache tag.
Table 5–3 cache Attributes
Attribute |
Default |
Description |
---|---|---|
key |
servletPath_suffix |
(Optional) The name used by the container to access the cached entry. The cache key is added to the servlet path to generate a key to access the cached entry. If no key is specified, a number is generated according to the position of the tag in the page. |
timeout |
60s |
(Optional) The time in seconds after which the body of the tag is executed and the cache is refreshed. By default, this value is interpreted in seconds. To specify a different unit of time, add a suffix to the timeout value as follows: s for seconds, m for minutes, h for hours, and d for days. For example, 2h specifies two hours. |
nocache |
false |
(Optional) If set to true, the body content is executed and served as if no cache tag is active. This offers a way to programmatically decide whether the cached response should be sent or whether the body must be executed, even if the response is not cached. |
refresh |
false |
(Optional) If set to true, the body content is executed and the response is cached again. This setting enables you to lets you programmatically refresh the cache immediately, regardless of the timeout setting. |
scope |
application |
Specifies the scope of the cache. Valid values are request, session, and application. |