I have an ASP.NET application that makes extensive use of ASP.NET cache API for caching commonly-used data. In addition, I am using polling-based sql cache dependency to track expiration.
The drawback of the current design is that, in the web farm environment, each web server has its own data cache that is not shared across servers.
Is there a way I can simply migrate the code to share data cache across multiple servers?
I've thought of using memcached however that would not work with sql cache dependency, right?
Any other solutions?
A distributed cache is a cache shared by multiple app servers, typically maintained as an external service to the app servers that access it. A distributed cache can improve the performance and scalability of an ASP.NET Core app, especially when the app is hosted by a cloud service or a server farm.
To manually cache application data, you can use the MemoryCache class in ASP.NET. ASP.NET also supports output caching, which stores the generated output of pages, controls, and HTTP responses in memory. You can configure output caching declaratively in an ASP.NET Web page or by using settings in the Web. config file.
In this article ASP.NET 1. x offered three different options for caching; output caching, fragment caching, and the cache API.
Redis is an open-source in-memory data structure project implementing a distributed caching, in-memory key-value database. Redis supports different kinds of abstract data structures, such as strings, lists, maps, sets, sorted sets, hyper log, bitmaps, streams, and spatial indexes.
Have you looked at Windows Server AppFabric (Formerly Velocity).
http://blogs.msdn.com/velocity/
You could use following options -
Use the approach described here for synchronizing the data across web farms - http://www.eggheadcafe.com/articles/20030420.asp
Use distributed caching approach
Use enterprise library cache.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With