Profile Cache Coherency

The Retail Solution Site uses a timestamp to detect an updated profile when a user is bounced to another Web server with cached information. The Web server checks the timestamp against the cached profile; if the timestamp is new (that is, the cache is old) the page does an explicit database roundtrip.

In a Web farm scenario, each server provides a local profile cache. The value of the user's profile (UserObject profile) in a particular cache can become outdated if the profile was changed on a different server. To help the server recognize that the user's profile has changed, a last updated timestamp is set in both the user's profile (in the Profiles store) and in a cookie for the user, when the profile is created and updated (UpdateUserProfile).

When a user visits a server in the Web farm, the timestamp in the profile in the local cache is checked against the timestamp in the cookie (GetCurrentUserProfile). If they are not equal, the profile is retrieved from the Profiles store (using the GetInfo method of the IADs interface), bypassing the local cache. If cookies are not enabled, the cache is always bypassed, because there is no reliable way to track the last updated time due to issues with using the Back button and page refresh.

The lookup of Address profiles is cached. Organization profile lookups, however, bypass the cache on an as-needed basis depending on how likely it is that the data in the profile will need to be changed.

Even with the timestamp solution, there are potential cache coherency issues with the profiles. For example, if a user's profile, which is currently cached, is changed from the Business Desk or Partner Desk on a different computer by a different user, the sites will not know that the cache is out of date. To mitigate this, the Solution Sites call the GetInfo method upon login.

If this level of accuracy is not acceptable, the Solution Sites include the m_iGlobalProfileLookUpOption variable, declared in the file include\setupenv.asp, which when set always forces a GetInfo method call to retrieve the profile from the Profiles store.

Commerce Server Solution Sites are available at https://go.microsoft.com/fwlink/?linkid=6491.

Copyright © 2005 Microsoft Corporation.
All rights reserved.