Pergunta

Is it possible to share a cached item amongst several windows services?

 List<GetPortedNumbersResult> col = (List<GetPortedNumbersResult>)result.ToList();

 var cache = MemoryCache.Default;
 CacheItemPolicy policy = new CacheItemPolicy();
 cache.Add(new CacheItem("PortedCol", col), policy);
Foi útil?

Solução

Adrian Thompson Phillips hit the nail on the head with a distributed cache. I think that will be your best bet.

The only thing I'll add, is that I would consider App Fabric (http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx) since it's Microsoft's version of a distributed cache.

You can even run App Fabric nodes on the same machine that has the Windows services. You don't need dedicated cache nodes in the cluster.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top