Command caching for marketing
The most resource-intensive part of evaluating a marketing rule is processing the query to return the Service Data Object (SDO) business object. The SDO business object for categories, catalog entries, and marketing content displays in an e-Marketing Spot. Command caching stores the results of earlier queries in cache to take advantage of lower retrieval times in comparison to retrieving results from main storage. The sample cachespec.xml can be found in the following location:
- WCDE_installdir\samples\dynacache\marketing\
Display Promotion action
If we are using the Display Promotion action, then we must update the cachespec.xml to use the command RetrieveContentTaskCmdImpl instead of the command FilterContentTaskCmdImpl. If we are not using the Display Promotion action, then we can use the FilterContentTaskCmdImpl command.
Cache entry verification
To verify that cache is receiving data properly check the cache entries in the cache monitor.
Typical cache entry
Template Cache ID Timeout Dependency ID com.ibm.commerce.marketing.commands.marketingspot.FilterContentTaskCmdImpl com.ibm.commerce.marketing.commands.marketingspot.FilterContentTaskCmdImpl: getCacheKey=10201:getStoreId=10101: getLanguageId=1:getActivityId=11500: getCatalogId=10101:getContracts=11001: getActiveOrg=2000: getExperimentId=:getTestElementId= 10800 dialogMarketingCommand activityId:11500 contentId:10201
Cached data invalidation
Establish that data is correctly added to the cache; then ensure that the cached data retrieved is not stale or invalid. Command-based invalidation policies in the cachespec.xml file ensure that users of the store are not browsing cached content which is changed in the database. For example, changes such as adding items to a catalog, or changing prices are not reflected in the data stored in the cache. See Cache invalidation.If the marketing information in the database is updated by using SQL statement, loading utilities, or staging utilities, then clear all cached information. To clear marketing information in the command cache, business object cache, and JSP caches, select the Marketing registry in the Administration Console Registries page. See Updating registry components.Note: Clearing the cached information is not required if you use staging utilities to update marketing information and use the e-Marketing Spot JSP caching technique that is based on activity behavior. Clearing the cached information is required when we are using SQL statements with any caching technique.
Related tasks
Setting up command caching for marketing
Tuning the marketing business object cache
Related reference
Marketing performance tuning
Marketing cache design considerations
Commands and methods for generating a cache key