Reputation: 822
In Asp.net you can cache objects on the local web server using HttpRuntime.Cache. Does this work in Azure?
I know Azure has managed caching services, but the costs are rather expensive. I'm caching a very small amount of data that rarely changes so each website caching separately is acceptable.
Upvotes: 1
Views: 448
Reputation: 24895
Using HttpRuntime.Cache
works fine in Windows Azure. The only thing is, if you're using multiple instances, it could be that this cache gets inconsistent between instances. But it depends on how static your data is.
If you're caching simple data like countries, cities, ... you'll be fine with HttpRuntime.Cache. Now if your data is a bit more dynamic, you should consider using Windows Azure Caching (not Windows Azure Shared Caching). Windows Azure Caching will reserve some memory on your instances to create a distributed cache. This means you'll have consistency over all instances when accessing the cache. And it's free (it simply uses resources you're already paying for).
Upvotes: 5