0

Configuration the ASP.NET Output Cache Provider for Windows Azure Caching

I'm a bit confuse about applicationName attribute.

Does it mean I can use multiple applications share the same Azure cache (as long as I don't max out Transactions, Data Transfers and Connections)?

In other words, same cache key won't collide between different web applications as long as applicationName are different?

1 GB cache for $110.00 is a lot cheaper than 10 X 128 MB cache for $45.00.

Thank you for shedding the light!

Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201
Win
  • 61,100
  • 13
  • 102
  • 181

3 Answers3

0

If we consider the architectural design for out-of-box cache, so when you have multiple instances of same application running in cloud and using a out-of-box cache, to keep all of the instances in sync with regard to output cache.

When you have multiple applications 1) / Root 2) /production 3) /test you really don't want to mix output cache between two different applications because output cache could have full page and partial page cache distributed at cache endpoint based on application name (if configured) or AppID provided by the IIS system.

IF you are using multiple sites within the same ASP.NET Web Role application then you can use dataCacheClient to separate output cache based on different host headers for different sites withing the same application, that would be preferred solution.

AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65
  • How does it work with regular single web application (with 2 instances) within single ASP.Net Web Role? Do I have to explicitly set the applicationName (otherwise, one instance's cache cannot be accessed by other instance - which will really defeat the purpose of distributed cache)? Thank you for shedding the light! – Win May 31 '12 at 19:35
0

Based on the MSDN link, the ApplicationName is used internally to generate the Cache Key. If application key is not provided it uses HttpRuntime.AppDomainAppId. Now the onus is on the development team to udpated IIS metabase so that HttpRuntime.AppDomainAppId in each instance resolves to same value.

In short ApplicationName name is used to provide an additional layer of segregation, If ApplicationName match in different apps, those apps would use the same cache.

Chandermani
  • 42,589
  • 12
  • 85
  • 88
0

The difference in usage of applicationName tag for session state and output caching is mentioned here: http://msdn.microsoft.com/en-us/library/hh361708.aspx

In context to the question asked here, applicationName tag is handy to cache data between multiple instances of the same role.

Alfan
  • 235
  • 2
  • 10
  • You are just copying the exact same content I was asking. Anyhow, Windows Azure Caching (Preview) is out, and I do not have to worry about sharing cache (to save money) with different cloud services anymore. – Win Jul 02 '12 at 17:16