Home
Validate the caching configuration
In our sample environment, we used a simple web page to test the caching behavior of the configuration. See Example 6-14 for a simple dynamically-generated web page. If the caching is working, the time on the page will not update when you refresh the web page.
Example 6-14 Test.jsp to verify dynamic cache behavior
<html><head><title>Dynacache Tester</title></head><body>
<H1>Test JSP</H1>
The time is <%=new java.util.Date().toString() %> <BR>
If the time does <b>not</b> update upon page refresh then the dynacache is working correctly<BR>
</body></html>
See Example 6-15 for the corresponding cachespec.xml.
Example 6-15 cachespec.xml deployed in the WEB-INF directory of the web module
<?xml version="1.0" ?>
<!DOCTYPE cache SYSTEM "cachespec.dtd">
<cache>
<cache-entry>
<class>servlet</class>
<name>/Test.jsp</name>
<cache-id>
<component id="*" type="parameter">
<required>false</required>
</component>
<timeout>180</timeout>
</cache-id>
</cache-entry>
</cache>
The web page can be executed with a number of arbitrary parameters to create cache entries. For example, the following will create a new cache entry each:
http://localhost:9080/DynacacheTestWeb/Test.jsp?anyparam=anyvalue1
http://localhost:9080/DynacacheTestWeb/Test.jsp?anyparam=anyvalue2
http://localhost:9080/DynacacheTestWeb/Test.jsp?anyparam=anyvalue3
The caching statistics of the Test.jsp can then be reviewed in the appropriate monitoring tools introduced in 6.4, Monitoring considerations.
Error 404 - Not Found Error 404 - Not Found
The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.