Search This Blog

Friday, November 23, 2012

Differentiate cache id for mobile and base stores


The Madisons mobile starter store has some shared views with Madisons starter store.
For these shared views, how can different cache-ids be generated to cache the mobile version of the page separate from the non-mobile version of the same page?

1) In the wc-server.xml file, add the following code to /config/Components/component[name="DynaCacheFilterMappings"]:

                <map className="com.ibm.commerce.dynacache.filter.DeviceFormatIdCallBack" display="false" dynacacheAttributeName="DC_deviceFormatId" methodName="setDeviceFormatId" name="setDeviceFormatId"/>


This callback is used to generate the CacheFilter attribute "DC_deviceFormatId"


2) In the cachespec.xml file, add the following to all cache-id entries that are shared by the base store and the mobile store:

            <component id="DC_deviceFormatId" type="attribute">
                <required>true</required>
            </component>

No comments:

Post a Comment