Overview of e-Marketing Spot JSP caching based on activity behavior
The caching technique that is based on activity behavior is provided to aid in the caching of e-Marketing Spots and to help improve storefront performance.
Previously, the marketing caching technique required the marketing engine to determine what information displays in an e-Marketing Spot. The marketing engine used the dynacache command cache and distributed map cache entries to cache the results that display in the e-Marketing Spot. This technique allowed the marketing engine to handle the dynamic aspects of marketing activities such as experiments, while it used cached entries wherever possible.
However, in practice, many e-Marketing Spots are static and display the same results to all customers. For a static e-Marketing Spot, JSP cache is the best caching technique. The e-Marketing Spot JSP fragment can be cached. If the e-Marketing Spot is on a fully cached page, then the e-Marketing Spot can be consumed by the parent page. Setting the e-Marketing Spots that can use a JSP cache requires continuous manual support.
The marketing caching technique that is based on activity behavior allows for optimal caching of e-Marketing Spots with no manual involvement. The marketing engine automatically detects if the e-Marketing Spot is static or dynamic. If the e-Marketing Spot is static, then JSP caching can be used for the e-Marketing Spot results. If the e-Marketing Spot is dynamic, then the marketing engine determines the content to display. The marketing engine then uses the dynacache command cache and distributed map cache entries to display the results. Configuration is set in the e-Marketing Spot JSP snippets and the store cachespec.xml file, then static e-Marketing Spots are automatically JSP cached.
Static and dynamic
A static e-Marketing Spot, at any time, schedules only those activities that display the same results to all customers. The activities do not contain targets, branches, or experiments. The activities can have specific start and end dates.
A dynamic e-Marketing Spot, at any time, has one or more scheduled activities whose behavior can depend on the current customer or the current context. These activities use targets, branches, and experiments.
An e-Marketing Spot can have dynamic behavior when the content displayed in the spot changes based on customer-specific information or other conditions. Most content is static, meaning the same content is displayed to all customers. However, content can include substitution variables or promotion proximity tags that dynamically change the displayed information. For example, a substitution variable can display the customer’s name, while a promotion proximity tag can display the additional amount the customer needs to spend to qualify for a promotion. If the displayed content can change based on these variables or conditions, the e-Marketing Spot has dynamic behavior. The Marketing Manager must identify any content that has dynamic behavior. For more information, see Marketing Manager and Creating marketing content to display on store pages.
Invalidation
The wcf:eMarketingSpotCache tag dynamically sets dependency IDs for
e-Marketing Spot dynacache entries. The Quick Publish and Stageprop processes on the staging
database create rows in the CACHEIVL table on the production database.
When the DynaCacheInvalidation scheduled job runs on the production
environment, it reads from the CACHEIVL table and issues dynacache
invalidations to invalidate dynacache entries with matching dependency ids. Invalidation is
done for both cached JSP entries, and for dynacache entries in the marketing distributed map
caches
- e-Marketing Spot (ID or name) - when an e-Marketing Spot is created, updated, or deleted
- e-Marketing Spot (ID or name) - when an activity associated with an e-Marketing Spot is activated or deactivated
- e-Marketing Spot (ID or name) - when a promotion associated with an activity scheduled to an e-Marketing Spot is activated or deactivated
- Content (ID) - when marketing content is created, updated, or deleted
- Content (ID) - when an Asset associated with the content is updated, or deleted
- When a page time limit is set to invalidate the page if an activity is scheduled to be added to, or removed from the e-Marketing Spot. The page times out at the next scheduled activity transition time. When the page is reloaded, the new set of activities for the e-Marketing Spot is in effect.
- When a dependency is set for the e-Marketing Spot (or all static e-Marketing Spots on a full page cache). This dependency invalidates the page when an e-Marketing Spot changes. These changes include when activities are added to, or removed from the e-Marketing Spot, and when the activities scheduled to the e-Marketing Spot change.
- When dependencies are set for the results that are displayed in the e-Marketing Spot. These dependencies can invalidate the cached page when the products, categories, or content that are displayed in the e-Marketing Spot change.
- Invalidation is set to occur after Quick Publish and stage propagation. The applicable cached entries are invalidated without clearing the entire Marketing registry.
A static e-Marketing Spot associated with a web activity that contains a Recommend Promotion action, invalidates at the activity start and end dates. The e-Marketing Spot JSP does not invalidate at the promotion start and end dates. For example, if the associated promotion is set to end before the activity ends, the e-Marketing Spot JSP cache does not invalidate when the promotion ends. The storefront e-Marketing Spot JSP continues to present the promotion. To ensure that the cached e-Marketing Spot JSP invalidates when the promotion begins and ends, set the activity start and end dates to match the promotion.
Caching
In the cachespec.xml file, the e-Marketing Spot JSP fragment has a cache entry. This cache entry specifies do-not-cache and do-not-consume to be true. However, these settings are only the default values; the actual values are set dynamically by the EMarketingSpotMetaDataGenerator when the page is loaded.
- If any of the activities are dynamic, then the e-Marketing Spot JSP is not consumed by the parent page, and is not cached. The marketing engine is called to evaluate the activities and return the personalized results.
- If all of the activities are static, then the e-Marketing Spot JSP is cached. The
EMarketingSpotMetaDataGenerator checks if the page that contains the e-Marketing Spot
JSP is being cached.
- If the parent page is being cached, then the e-Marketing Spot JSP is consumed by the parent, and cached as part of the parent page
- If the parent page is not being cached, then the e-Marketing Spot JSP is cached as a separate JSP fragment
- The earliest start date of activities that are scheduled for the e-Marketing Spot
- The earliest end date of activities that are scheduled for the e-Marketing Spot
- The timeout value that is set in the cachespec.xml file
- If the parent page is being cached, the timeout is set on the parent page cache entry
- If the parent page is not being cached, the timeout is set on e-Marketing Spot JSP cache entry
wcf:eMarketingSpotCache tag. This
tag dynamically sets dependency IDs on the cache entry. Dependency IDs are set for the
e-Marketing Spot (ID or name). Dependency IDs can also be set for the data (catalog entry,
category, content) that is being displayed in the e-Marketing Spot.- If the parent page is being cached, the dependency IDs are set on the parent page cache entry
- If the parent page is not being cached, the dependency IDs are set on e-Marketing Spot JSP cache entry