对跨进程的基本内存缓存的建议

recommendation for basic memory caching across process

实现是针对在 .net 4.5 中编码的简单场景,

  1. 在可序列化对象列表的内存缓存中
  2. 列表的setter和getter驻留在不同的进程
  3. 理想情况下,缓存提供了一种内置的线程安全方式来访问缓存项

最初我想使用静态 class 或 MemoryCache,但在想出一种跨进程共享缓存的方法时遇到了一些麻烦。这适合 Redis 缓存吗?

是的,Redis 非常适合解决不同应用程序访问缓存的问题。它有很多功能 - 请参阅 http://redis.io/documentation, all the data is kept in memory so it is very fast, it is thread safe because it has just one thread doing the work and there is good support for it in the .NET world - see the https://github.com/StackExchange/StackExchange.Redis