Dynamic caching in the Madisons mobile starter store
The Madisons mobile starter store enables dynamic cache by default, similar to other WebSphere Commerce starter stores. With Dynamic caching, the server load is reduced, as significant segments of the page do not have to be retrieved from the server on every new page display.
To ensure the dynamic cache service is enabled, see Enabling the dynamic cache service and servlet caching.
For configuration information, see Configuring the dynamic cache service.
Caching strategy in the Madisons mobile starter store
- mIndex
- mCategoriesDisplayView
- mProductDisplayView
- mContactUs
- mPrivacyPolicy
- CachedHeaderDisplay
- CachedFooterDisplay
- Categories
- BreadCrumbTrailDisplay
Madisons mobile starter store cachespec.xml file
- WC_installdir/samples/dynacache/Madisons/mobile
- WCDE_installdir/samples/dynacache/Madisons/mobile
The default Madisons mobile starter store cachespec.xml file contains basic caching examples for the catalog browsing pages and static pages. It should be modified accordingly to meet your store's specific caching requirements, and the invalidation rules copied manually. It is recommended to cache responses that are common to all customers such as category browsing, and not those that can be different to customers such as shopping carts. See Adding sample invalidation policies to your store's cachespec.xml file for more information.
Separately caching shared views
- In the wc-server.xml file, add the following code to the
/config/Components/component[name="DynaCacheFilterMappings"]
section:
Where the callback is used to generate the DC_deviceFormatId CacheFilter attribute.<map className="com.ibm.commerce.dynacache.filter.DeviceFormatIdCallBack" display="false" dynacacheAttributeName="DC_deviceFormatId" methodName="setDeviceFormatId" name="setDeviceFormatId"/>
- In the cachespec.xml file, add the following to all cache-id entries that
are shared by the Madisons starter store and the Madisons mobile starter
store:
<component id="DC_deviceFormatId" type="attribute"> <required>true</required> </component>