Caching across Applications in .Net on a Windows M

2019-07-18 08:00发布

I am trying to implement caching in .Net such that the cached data is accessible not just by an application that may run multiple times on the same machine but by other types of applications that may run on the machine. They could be windows services, web services, win forms etc.

I have looked at System.Runtime.Caching (because Enterprise Application Blocks Caching is going to become obsolete) as a means to achieve this. The default MemoryCache is insufficient to achieve this as I don't believe that it work across app domains.

Is there a way I can implement the kind of caching I am looking for or is there a caching dll of some sort (must be free) that I can use to achieve my goal?

Is there a way to use System.Runtime.Caching with IsolatedStorage scoped to MachineLevel?

I've looked at memcache too and can't use it because we need this to run on windows machines. I started looking at SharedCache (http://www.codeproject.com/KB/web-cache/AdvanceCaching.aspx) and am curious about the pitfalls it has as well.

Thanks.


-- Revision 1 --


I think the optimal solution for me would use the Caching object to a Memory Mapped File (http://msdn.microsoft.com/en-us/library/dd997372.aspx). So the question I have now is whether anyone has done that with the System.Runtime.Caching object. There must be a way to extend it if necessary...examples of how to do so would also be much appreciated.

标签: c# .net caching
2条回答
男人必须洒脱
2楼-- · 2019-07-18 08:34

You're looking for AppFabric Cache. It's a Windows Server technology from Microsoft. It's free.

I should also say that if you like memcached, you can use that on Windows as well, and in fact Microsoft Azure team members used to recommend it, before the AppFabric caching was available on Windows Azure.

查看更多
smile是对你的礼貌
3楼-- · 2019-07-18 08:50

Have you evaluated Microsoft Velocity? Take a look - I believe if you are not okay with using the AppFabric Cache, this should work out for you: http://msdn.microsoft.com/en-us/magazine/dd861287.aspx#id0450004

For simple client based caching, you can look at file based caching.

查看更多
登录 后发表回答