Tutorials > Dynamic caching > Improve WebSphere Commerce performance with dynamic caching
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.
Procedure
- Open the cachespec.xml file located at WC_EAR\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.
- Verify the consume-sub-fragments flag exists and is set to true for the cache-entry.
Note:
- 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 type="pathinfo"> <required>true</required> <value>/TopCategoriesDisplay</value> </component> <component type="parameter"> <required>true</required> </component> <component type="parameter"> <required>true</required> </component> </cache-id> </cache-entry>
- Test out the cachespec.xml. Note: 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.