I made changes in DynaCacheSample to try this by first creating ServletInstanceOne cache instance using the WAS Admin Console at the cell level like this
Then i changed the cachespec.xml file in my web application to add cache-instance element with name equal to JNDI name of the cache instance that i just configured and making all the cache-entry elements as its child element. If you want you can create multiple cache instances and use one instance for each of the cache entry. My cachespec.xml looks like this
<?xml version="1.0" ?>
<!DOCTYPE cache SYSTEM "cachespec.dtd">
<cache>
<cache-instance name="services/cache/instance_one" >
<cache-entry>
<class>servlet</class>
<name>/dynacacheservlet</name>
<cache-id>
<component id="action" type="parameter">
<required>false</required>
</component>
<timeout>180</timeout>
</cache-id>
</cache-entry>
<cache-entry>
<class>servlet</class>
<name>/dynachache.jsp</name>
<cache-id>
<component id="action" type="parameter">
<required>false</required>
</component>
<timeout>180</timeout>
</cache-id>
</cache-entry>
<cache-entry>
<class>static</class>
<name>com.ibm.ws.webcontainer.servlet.SimpleFileServlet.class</name>
<cache-id>
<component id="" type="pathinfo">
<required>true</required>
</component>
<component id="If-Modified-Since" type="header">
<required>false</required>
</component>
<timeout>300</timeout>
</cache-id>
</cache-entry>
</cache-instance>
</cache>
I did deploy the new application and try hitting the URL few times. Now when i use the CacheMonitor application i can see the
services/cache/instance_one
cache instance in it with the servlet content being stored in it like this
No comments:
Post a Comment