Azure - what is the purpose of applicationName in Azure Caching?

318 Views Asked by At

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!

3

There are 3 best solutions below

1
On BEST ANSWER

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.

0
On

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.

1
On

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.