Dynamic caching in the Aurora starter store

In the Aurora starter store, dynamic caching is enabled by default. Dynamic caching reduces the server load because significant segments of the page, such as store widgets, do not have to be retrieved from the server on every new page display.

To ensure that the dynamic cache service is enabled, see Enabling the dynamic cache service and servlet caching.

For configuration information, see Configuring the dynamic cache service.

Full page caching

Full page caching is used in the TopCategoryDisplay, CategoryDisplay, and ProductDisplay pages. Cache the AJAX response view for each of the refresh areas, if possible. Cache responses that are common to all customers, such as category browsing. Do not cache responses that can be different from one customer to the next, such as shopping carts.

Aurora starter store cachespec.xml file

You can view the cachespec.xml file that comes with the Aurora starter store in the following directory:
  • LinuxAIXWindowsWC_installdir/components/samples/dynacache/Aurora
  • WebSphere Commerce DeveloperWCDE_installdir/components/samples/dynacache/Aurora
Note: If you are using the extended sites business model, or if you renamed the store directory, edit the cachespec.xml file and replace all instances of Aurora with your new store directory name.

The default Aurora starter store cachespec.xml file contains basic caching examples for the catalog browsing pages and static pages. Modify it to meet your specific caching requirements. Manually copy the invalidation rules. For more information, see Adding sample invalidation policies to cachespec.xml file.

Samples for setting up caching for WebSphere Commerce search

When the WebSphere Commerce Search index is built or updated, dependency IDs must be published to invalidate catalog entry and category pages in the JSP cache. You must add the dependency IDs to the wc-component.xml file for the catalog component. If you are using the sample cachespec.xml file that is provided with Aurora starter store, you can use the following example configuration properties to add the dependency IDs to the wc-component.xml file:
In the file, change the following default fragment:

<_config:property name="CacheInvalidationForCatalogEntry" 
  value="" />
<_config:property name="CacheInvalidationForCatalogGroup" 
  value="" />
To:
<_config:property name="CacheInvalidationForCatalogEntry"	
  value="ProductDisplay:productId:$catEntryId$,productId:$catEntryId$" />
<_config:property name="CacheInvalidationForCatalogGroup" 
  value="categoryId:$catGroupId$" />

For detailed instructions on changing properties in a custom wc-component.xml file, see Changing properties in the component configuration file (wc-component.xml) (WC EAR). If it does not matter that your updates will be overwritten with future software updates, you can update the wc-component.xml file directly at this path:

WebSphere Commerce DeveloperWCDE_installdir\workspace\WC\xml\config\com.ibm.commerce.catalog-fep\wc-component.xml

When you modify the URLs for product and category pages, the configuration parameter values might be different from the examples.

Separately caching shared views

The Aurora starter store contains shared views with the Aurora mobile starter store. You can generate different cache-ids for the shared views to separately cache the mobile version of the page from the non-mobile version of the same page.
  1. In the wc-server.xml file, add the following code to the /config/Components/component[name="DynaCacheFilterMappings"] section:
    
    <map
       className="com.ibm.commerce.dynacache.filter.DeviceFormatIdCallBack"
       display="false" dynacacheAttributeName="DC_deviceFormatId"
       methodName="setDeviceFormatId" name="setDeviceFormatId"/>
    
    Where the callback is used to generate the DC_deviceFormatId CacheFilter attribute.
  2. In the cachespec.xml file, add the following to all cache-id entries that are shared by the Aurora starter store and the Aurora mobile starter store:
    
    <component id="DC_deviceFormatId" type="attribute">
       <required>true</required>
    </component>
    

Separately caching multiple stores published from the Aurora.sar store archive

You can publish the Aurora.sar store archive as any of the following store types:
  • B2C stand-alone store or storefront asset store
  • B2B direct stand-alone store or storefront asset store

However, if you publish multiple stores in the same environment, all stores share cachespec.xml file. If you want to cache each store separately, you must duplicate the store-specific cache entries in the cachespec.xml file so that there is an entry for each store that you published. To modify the cachespec.xml file, complete these steps:

  1. Open your cachespec.xml file in an editor.
  2. Search for the first cache entry that contains the store name, for example, /Aurora/.
  3. Copy the line of code and paste it underneath the line that you copied.
  4. In the copied line, replace the store name with the name of the additional store that you published. For example, replace /Aurora/ with /AuroraB2B/.
  5. Repeat these steps for each additional cache entry that contains the store name.
  6. Save and close the file.
  7. Restart the server.