com.ibm.ws.webcontainer.servlet.SimpleFileServlet
Servlet that gets request if a request is made to static resource in the web application. You can enable caching for SimpleFileServlet so that the content of static resource is cached.I wanted to try that so i made changes in my DynaCacheSample.war to add sample.js and enableservletcaching1.GIF files in it and then dynacache.jsp includes both these files. I changed the cachespecs.xml file of the DynacacheSample.web to add this cache-entry element
<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>
You can download the DynaCacheSample.war from here
I did deploy the modified DyanCacheSample.war file on the sever and tried hitting it few times this is what i see in the CacheMonitor application
As you can see in addition to content of dynacacheservlet and dynacache.jsp, now the content of sample.js and enableservletcaching1.gif is also cached
No comments:
Post a Comment