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 also be dynamic if the content displayed in the e-Marketing Spot is dynamic. Most content is static and the same content is displayed for all customers. In some situations, the content can have substitution variables or promotion proximity tags that change the content. For example, to display the customer name or the amount a customer further requires to receive a promotion. If the displayed content can change, then the e-Marketing Spot behavior is dynamic. The Marketing Manager is required to identify any content that has dynamic behavior. For more information, see Creating marketing content to display on store pages.

Invalidation

The wcf:eMarketingSpotCache tag dynamically sets dependency IDs for cached e-Marketing Spots. Many of these invalidations are automatically issued. The Quick Publish and Stageprop processes on the staging database creates entries in the CACHEIVL table on the production database. When the DynaCacheInvalidation scheduled job run on the production environment, then the dynacache invalidations are issued, and invalidates the appropriate dynacache entries. Invalidation is done for both cached JSP entries, and for the marketing distributed map cache.

Invalidations are set up for the following scenarios:
  • 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.
Note: Invalidations are not configured for catalog entries or categories

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.

When the page that contains the e-Marketing Spot JSP is first loaded, the EMarketingSpotMetaDataGenerator checks the behavior of the activities active on the e-Marketing Spot.
  • 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
When the e-Marketing Spot JSP is being cached, the EMarketingSpotMetaDataGenerator dynamically sets the timeout of the page. The timeout is set to the earliest time from the following set of values:
  • 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
This timeout allows the e-Marketing Spot JSP to be invalidated at activity transition times. When the page is reloaded, it is cached again with the updated relevant set of activities.
  • 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
The e-Marketing Spot JSP page contains a 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
(Note: There are optional configuration flags that can override the checking of the e-Marketing Spot behavior. These flags can also set if the page is to be consumed by the parent page)