Tag Archive: caching


Free multi-server caching from Microsoft

Caching is absolutely the most effective way to speed up the performance of an app.  However, .NET does not have a reasonable tool for caching data, such as the contents of a database table, across all servers for all users.*  There are third party tools that do this, but they are pricey.

A tool called AppFabric is available from Microsoft (for free) that spans the cache for all users across all web servers in a farm/garden/cluster.  Downside: it’s only available for current operating systems like Windows 7, Vista, and Server 2008.

If you’re interested, here are some tutorials:

http://msdn.microsoft.com/en-us/library/ee677288.aspx
http://msdn.microsoft.com/en-us/library/hh334305.aspx
http://www.microsoft.com/download/en/details.aspx?id=27115

.NET can cache data for all users on one server (using Cache), or for one user on all servers (using Session), but not for all users on all servers

Universal Caching

I wrote this library so I don’t have to keep track if I should use HttpRuntime.Cache, AppDomain.CurrentDomain.SetData, HttpContext.Current.Session, or a Dictionary…now I just use GlobalCache or UserCache.  It also makes unit testing a webapp a snap, because if you use IGlobalCache/IUserCache in your code, you just inject the Windows-based cache in your unit test setup.

You can download the solution with dlls here: Universal Caching solution

© 2017 Robert Corvus