Modifying the Cache Refresh Configuration

If you want your business users to update your live Web site using the business management tools (either the Desktop Business Tools or the Commerce Server Business Administration Ribbon), you must enable cache refresh.

By default, the cache refresh configuration already exists in Web.config for the Solution Storefront and for custom SharePoint 2010 sites based on the Solution Storefront. For the out of box Solution Storefront site, the enabled attribute is set to true and the pollingInterval is preconfigured to 30 seconds.

Note

When you implement cache refresh using the pull or polling method, you must implement the following prerequisites to ensure synchronized cache refresh polling across all servers:

  • The time on all servers is synchronized.
  • The cache refresh polling interval is the same for all servers. For more information about synchronized cache refresh polling, see the section entitled Prerequisites for Cache Refresh in Working with Cache Refresh (Pull or Polling Model).

Modifying the Cache Refresh Configuration Attributes for the Presentation and Application Tier

The cache refresh configuration allows you to do the following:

  • Enable or disable the cache refresh polling in the presentation tier and application tier

  • Adjust the interval at which both the presentation tier and the Commerce Foundation operation service polls for cache refresh requests

<microsoft.commerce>
...
      <server>
      ...
           <CacheRefresh enabled="false" pollingInterval="30" />

      </server>
</microsoft.commerce>

You can configure the following cache refresh attributes:

Attribute

Description

Possible values

Default value

enabled

Enable or disable polling for cache refresh requests

true

false

false

pollingInterval

The interval in seconds at which both the presentation tier and the Foundation OperationService poll for cache refresh requests

Positive integer between 1 and 86400

Hh567746.alert_note(en-us,CS.95).gifNote:
The value is ignored if the enabled attribute is set to false.

If the specified value is a negative number or greater than 86400, the system generates an System.Configuration.ConfigurationErrorsException.

For information about setting this value, see Polling Interval Performance Considerations.

30

Depending on your deployment scenario, you must ensure the cache refresh configuration appears in the appropriate configuration file(s):

Deployment scenario with Solution Storefront or custom Web site based on Solution Storefront

Where to specify cache refresh configuration

Three-tier and three-tier Web farm

Web.config file for the Web application on the presentation tier (each node for Web farm)

Operation Service App.config or Web.config file on the application tier (each node for Web farm)

Two-tier and two-tier Web farm

Web.config file for the Web application (each node for Web farm)

Modifying the Cache Refresh Configuration for the Orders Web Service

The Orders Web service implements an HTTP handler to listen for cache refresh request message according to the push model. The Orders Web service also polls for cache refresh requests according to the pull or polling model. By default, the Orders Web service polls for cache refresh requests every 30 seconds.

The attributes for configuring cache refresh polling are optional. If you want to change the default cache refresh behavior of the Orders Web service, you must add the cacheRefreshPollingEnabled and cacheRefreshPollingIntervalSeconds attributes to the Orders Web service Web.config file and change the value for the appropriate attribute. For more information, see ordersWebService Element.

Polling Interval Performance Considerations

Performance is a consideration when setting the pollingInterval attribute. If the interval is too long, you increase the probability that the servers have obsolete data in their cache; if the interval is too short, you may use more system resources refreshing the cache and lose the performance and scalability improvements gained from caching data. If certain data in your cache needs to be refreshed too frequently, it may mean that such data is not a suitable candidate for caching.

A Web farm presents unique performance considerations when it comes to caching data. In a Web farm scenario, each Web server has its own copy of the data cached in memory. As a result, data can become out-of-sync if the data on one Web server is updated independently of the others. Because you have no control over which server in a Web farm receives a request, the shopper might see different data from the cache depending on the server that responds to the request.

For example, a business user updates the price of a product. The product update is handled by server A, but the shopper's request to view the same product is handled by server B before its cache has been refreshed. Consequently, the shopper sees the old price taken from the stale cache on server B instead of the updated price.

With a Web farm, the probability of a shopper viewing a stale cache increases as the number of servers in the Web farm increases. In this case, you may want to set the pollingInterval attribute to a shorter timeframe to mitigate the probability of stale caches across multiple servers.

See Also

Other Resources

Working with Cache Refresh (Pull or Polling Model)

About the CommerceCache Entity

Overview of CommerceCache Operation Sequences

Using APIs to Manage Commerce Server Caches

Configuring Authorization Security for the CommerceCache Entity

Creating an HTTP Module for Presentation Tier Polling

ordersWebService Element