I would like to ask people’s opinion on methods and strategies for introducing Caching to WCF. In particular what i am most interested in, is injected SQL Cache Dependencies. Once a web application is copied to multiple application servers I want to synchronize the cache efficiently.
I am currently looking at the WCF Rest Starter Kit which introduces a nice WebCache attribute for OperationContracts in which you can add SqlCacheDependancies.
I am just interested and would be greateful for, others take or experience in tackling this problem.
Kind Regards,
Andrew
Not sure which problem you’re addressing, but you mention cache consistency across multiple servers. Having run a SqlCacheDependency configuration previously, here’s my take on it.
The SqlCacheDependency incorporated with the WebCache attribute is the same cache dependency implementation that’s been available since .Net 2.0. Overall, I find the aggregate configuration/operation/monitoring for SqlCacheDependency onerous. The design is acceptable for a single cache, but multiple systems — no thanks.
I like separation of concerns. When working with multiple servers, I find a distributed cache tier much easier to manage than the SqlCacheDependency operation. Plenty of open-source and commercial distributed cache providers available. I find Memcache to be the most effective and operationally sound.