开发者

Dispose cache from multiple web role instances from azure application

开发者 https://www.devze.com 2023-03-10 17:44 出处:网络
i am having a problem related to the cache disposal in azure cloud application. i am using MVC3 structure, using 2 instances.

i am having a problem related to the cache disposal in azure cloud application. i am using MVC3 structure, using 2 instances.

as we know that the Microsoft azure automatically allocates a web role to serve a web request based on load balancing.

but the problem is that when i dispose a cache "HttpRuntime.Cache.Remove("CacheName")", it is disposed of from the current web role that i am currently alloted by microsoft. and doesnt dispose the cache from the o开发者_开发技巧ther instance.

please help me, can i dispose a cache from the two instance a the same time? using any C# sharp code.


This is a good reason to use a distributed cache. Synchronizing cache adds and removes individually across many instances and caches is hard to do well. Any code or solution that attempts to solve the issue will be pretty hacky. Moving the caching out to a distributed cache will solve the problem for you correctly.

Have you looked at the Windows Azure AppFabric Caching solution?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号