Welcome to MSDN Blogs Sign in | Join | Help

Cristiano WebLog

Microsoft Infrastructure & Development Tips and Tricks
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.

Posted: Thursday, November 30, 2006 10:21 AM by crisag
Filed under:

Comments

No Comments

Anonymous comments are disabled
Page view tracker