Subscribing to the refresh cache event in Commerce Server 2007
Are you looking a way to extend the refresh cache webservice method to refresh ASP .Net cache on your Commerce Server 2007 website? If you are using ASP .Net output cache extensively and need to refresh the cache together with CS caches you can subscribe to the CacheRefresh event using the following code.
Subscription
SiteCacheRefresh.CacheRefresh += new System.EventHandler<SiteCacheRefreshEventArgs>(SiteCacheRefresh_CacheRefresh);
Event Handler
public void SiteCacheRefresh_CacheRefresh(object sender, SiteCacheRefreshEventArgs e)
{
}
As a recommendation, use Global.Asax to subscribe to the event. ASP.NET compiles global.asax into a class derived from the HttpApplication class, and then uses the derived class to represent the application.
If you are using a CS farm the event is triggered at all servers!
Regards! Cris.
This posting is provided "AS IS" with no warranties, and confers no rights.