Tutorial: Improve WebSphere Commerce performance with dynamic caching >
< Previous
Set up the cachespec.xml to full-page cache TopCategoriesDisplay
This section is related to setting up the cachespec.xml to full-page cache TopCategoriesDisplay.
- Open the cachespec.xml file located at WC_eardir\Stores.war\WEB-INF.
- Add a cache-entry for the TopCategoriesDisplay page to the cachespec.xml.
- Cache the servlet, com.ibm.commerce.struts.ECActionServlet.class.
- Include a pathinfo component with the value /TopCategoriesDisplay and a parameter type component for the storeId and for the catalogId.
- Set the required value of all components to true.
- Ensure that the consume-sub-fragments flag exists and is set to true for the cache-entry.
- A sample cachespec.xml file containing the required cache-entry is available in this zip format.
Your completed cache-entry for TopCategoriesDisplay should look like this
<cache-entry> <class>servlet</class> <name>com.ibm.commerce.struts.ECActionServlet.class</name> <property name="consume-subfragments">true</property> <property name="save-attributes">false</property> <property name="store-cookies">false</property> <!-- StoreCatalogDisplay?storeId=<storeId> --> <!-- TopCategoriesDisplay?storeId=<storeId>&catalogId=<catalogId> --> <cache-id> <component id="" type="pathinfo"> <required>true</required> <value>/TopCategoriesDisplay</value> </component> <component id="storeId" type="parameter"> <required>true</required> </component> <component id="catalogId" type="parameter"> <required>true</required> </component> </cache-id> </cache-entry>- Test out your cachespec.xml.
You do not need to restart the server for the new cachespec.xml to take effect.
- Open the cache monitor, and verify that the new policy is listed.
- Hit the TopCategoriesDisplay page.
- Verify that there is a cache-entry present for the TopCategoriesDisplay page.