Home


Caching the response in Sales Center

As well as caching the data model in the client, further performance gains can be made by caching the BOD that is returned to the Sales Center client by the Sales Center server in response to a service request.

Constructing the BOD may be a very resource consuming process. With the use of command caching the response BOD can be cached, and returned on the next request rather than recomputing it again. For example, the response builder command for GET store request (see Example | -1) is cacheable based on the retrieved properties such as search criteria, store ID, language ID, user parent member ID, user member group IDs and user roles.

Example: C-1 Cache Entry for the response BOD of Get Store request

<cache-entry>
        <class>command</class>
        <sharing-policy>not-shared</sharing-policy>
 | #160; | #160; | #160; | #160;<name>
 | #160; | #160; | #160; | #160; | #160; | #160;com.ibm.commerce.telesales.messaging.bodreply.ShowStoreCacheCmdImpl
 | #160; | #160; | #160; | #160;</name>
        <cache-id>
            <component type="method" id="getSearchCriteria">
                <required>true</required>
            </component>
            <component type="method" id="getStoreId">
                <required>true</required>
            </component>
            <component type="method" id="getLanguageId">
                <required>true</required>
            </component>
            <component type="method" id="getUserParentMemberId">
                <required>false</required>
            </component>
            <component type="method" id="getUserMemberGroupIds">
                <required>false</required>
            </component>
            <component type="method" id="getUserRoles">
                <required>false</required>
            </component>
            <component type="method" id="getEligibleTradingAgreementIds">
                <required>false</required>
            </component>
            <priority>1</priority>
            <inactivity>3600</inactivity>
            <timeout>86400</timeout>
        </cache-id>
        <dependency-id>Stores</dependency-id>
    </cache-entry>

The result of the response builder command is cached and is used by subsequent calls to avoid constructing the same response BOD again. The cached response BOD for GET store request is invalidated only if the store-related information is updated; for example, when the state of the store is changed. For example, to list stores with names beginning with "Special," the response BOD is constructed and cached. It takes time to search for the eligible list of stores using a database query. Subsequent calls to get the list of stores with names beginning with "Special" will be very fast. The cached response BOD is returned rather than executing the search query and there is no need to create the response BOD again.

+

Search Tips   |   Advanced Search