Campaign Caching for Solution Sites
The Solution Sites provide two caches for advertisements and discounts that are used by the Content Selection Framework (CSF). Site developers do not need to reference these caches. Unlike the catalog caches, these caches use Dictionary objects, so they are initialized in a slightly different way.
Advertisement Cache
Discounts Cache
Advertisement Cache
Initialization
The following code, from the InitCacheManager function, shows the creation of the advertising cache:
'Create the configuration dictionary.
Set dictCampaignConfig = GetDictionary()
dictCampaignConfig("ConnectionString") = _
dictConfig.s_CampaignsConnectionString
Set dictCampaignConfig("Evaluator") = oEvaluator
' oEvaluator is the Commerce Server ExpressionEvaluator.
' Configure CacheManager for ads.
oCacheManager.RefreshInterval("advertising") = 5*60
oCacheManager.RetryInterval("advertising") = 60
oCacheManager.LoaderProgId("advertising") = _
"Commerce.CSFLoadAdvertisements"
oCacheManager.WriterProgId("advertising") = "Commerce.CSFWriteEvents"
Set oCacheManager.LoaderConfig("advertising") = dictCampaignConfig
Set oCacheManager.WriterConfig("advertising") = dictCampaignConfig
Discounts Cache
Initialization
The following code, from the InitCacheManager function, shows the creation of the discounts cache:
'Create the configuration dictionary.
Set dictCampaignConfig = GetDictionary()
dictCampaignConfig("ConnectionString") = _
dictConfig.s_CampaignsConnectionString
Set dictCampaignConfig("Evaluator") = oEvaluator
' oEvaluator is the Commerce Server ExpressionEvaluator.
'Configure CacheManager for discounts.
'Setting RefreshInterval to 0 disables automatic refreshing.
oCacheManager.RefreshInterval("discounts") = 0
oCacheManager.RetryInterval("discounts") = 60 'seconds
oCacheManager.LoaderProgId("discounts") = "Commerce.CSFLoadDiscounts"
oCacheManager.WriterProgId("discounts") = "Commerce.CSFWriteEvents"
Set oCacheManager.LoaderConfig("discounts") = dictCampaignConfig
Set oCacheManager.WriterConfig("discounts") = dictCampaignConfig
See Also
Copyright © 2005 Microsoft Corporation.
All rights reserved.