Use this task to define cacheable objects inside the cachespec.xml, found inside the Web module WEB-INF or enterprise bean META-INF directory.
You can save a global cachespec.xml in the application server properties directory, but the recommended method is to place the cache configuration file with the deployment module. The root element of the cachespec.xml file is <cache>, which contains <cache-entry> elements.
The <cache-entry> element can be nested within the <cache> element or a <cache-instance> element. The <cache-entry> elements that are nested within the <cache> element are cached in the default cache instance. Any <cache-entry> elements that are in the <cache-instance> element are cached in the instance that is specified in the name attribute on the <cache-instance> element.
Within a <cache-entry> element are parameters that allow you to complete the following tasks to enable the dynamic cache with the cachespec.xml file:
When new versions of the cachespec.xml are detected, the old policies are replaced. Objects that cached through the old policy file are not automatically invalidated from the cache; they are either reused with the new policy or eliminated from the cache through its replacement algorithm.
For each of the three IDs (cache, dependency, invalidation) generated by cache entries, a <cache-entry> can contain multiple elements. The dynamic cache runs the <cache-id> rules in order, and the first one that successfully generates an ID is used to cache that output. If the object is to be cached, each one of the <dependency-id> elements is run to build a set of dependency IDs for that cache entry. Finally, each of the <invalidation> elements are run, building a list of IDs that the dynamic cache invalidates, whether or not this object is cached.
In this information ...Related information
| IBM Redbooks, demos, education, and more(Index) |