Validate the caching configuration
Home | Previous | Next


Validate the caching configuration


In our sample environment, we used a simple web page to test the caching behavior of the configuration. If the caching is working, the time on the page will not update when you refresh the web page.

<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>

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


+

Search Tips   |   Advanced Search