The dynamic cache service works within an application server Java virtual machine (JVM), intercepting calls to cacheable objects. This article describes some common runtime and configuration problems and remedies.
Recommended response | Enable servlet caching. On the Web container settings page of the administrative console, select the Enable servlet caching check box. |
Explanation | Cache entries are written to disk when the cache is full and new entries are added to the memory cache. Cache entries also are written to disk when Flush to disk is enabled in the administrative console and the server is stopped. |
Recommended response | Verify that Disk offload is enabled on the Dynamic cache service settings page of the administrative console. Also verify that cache entries written to disk are serializable and do not have the PersistToDisk configuration set to false. |
Recommended response | Ensure that the attributes and response are serializable. If you
do not want to store the attributes, use the following property in your cache
policy:<property name="save-attributes">false</property> |
Recommended response | Set the EdgeCacheable property to true in the cache
policy for those entries that are to be cached on the Edge.<property name="EdgeCacheable">true</property> |
Explanation | The DynaCacheEsi.ear file is required to send invalidations to external caches. |
Recommended response | Install DynaCacheEsi.ear using the administrative console. |
Problem | The cache is full and new entries are added to the cache. |
Explanation | Cache entries are evicted when the cache is full and new entries are added to the cache. A least recently used (LRU) eviction mechanism removes the least recently used entry to make space for the new entries. |
Recommended response | Enable Disk offload on the Dynamic cache service settings page of the administrative console so the entries are written to disk. You can also increase the cache size to accommodate more entries in the cache. |
Explanation | The maximum lifetime of an entry in disk cache is 24 hours. A timeout of 0 in the cache policy configures these entries to stay in disk cache for one whole day, unless they are evicted earlier. |
Recommended response | Set the timeout for the cache policy to a number less than 0. |
Explanation | Use the dynamic cache monitor to monitor the contents of the memory cache, disk cache and external caches, like the Edge cache. For the ESI processor's cache to be visible in the cache monitor, the DynaCacheEsi.ear application must be installed and the esiInvalidationMonitor property must be set to true in the plugin-cfg.xml file. |
Recommended response | Set the esiInvalidationMonitor property in the plugin-cfg.xml file to true. See Displaying cache information for more information. |
Recommended response | Use the Tivoli Performance viewer to study the caching behavior for
your applications. Also consider performing the following actions:
|
Symptom | If the server is configured to use the disk cache, you must delete the disk cache files because the disk cache files are not compatible to the previous version. |
Problem | Failure to remove the old disk cache files results in a ClassCastException error in the systemerr.log file when you access the cache from the disk. |
Recommended response | To delete the disk cache, perform the following steps:
|
Symptom | When you obtain the JavaServer Pages (JSP) file from the dynamic cache, a part of the page is not displayed. |
Problem | The flush attribute is set to false on the <jsp: include> tag in the JSP file. |
Description | When the cacheable JSP file includes another JSP file and if the flush attribute is set to false on the <jsp: include> tag, any data written to the parent output stream before the<jsp: include> tag are not cached. |
Recommended response | Set flush=true on every <jsp: include> tag in the cacheable JSP file. |
Problem | When a cacheable fragment is included using the JavaServer Pages Standard Tag Library (JSTL) <c:import> tag, part of the page content disappears and part of the page content displays twice on a cache hit. |
Description | Dynamic cache relies on flushing the content before and after including
a fragment so that the parent content before the include is not lost, and
also to prevent pulling the child content into the parent fragment. However, in the case of the JSTL <c:import> tag, the flush=true attribute, which flushes the parent writer before the child fragment is actually invoked, is not supported. Also, JSTL buffers the responses, so that the child writer is not flushed right after the child fragment is done. Subsequently, the child response is pulled into the parent. |
Recommended response | To avoid this problem, surround the <c:import> statement
with out.flush method statements as follows: <% out.flush(); %> <c:import url="DNCParent2.jsp" /> <% out.flush(); %> |