Caching in WCF?

Viewed 52304

I am building a WCF service. I need to store reference data in the cache which I will look up every time I receive input from the method... What is the right way to do this? I would also like to define an expiration policy for the cache that will invalidate it after a certain time interval.

9 Answers

You could take a look at Velocity. This is Microsoft's distributed in-memory caching framework. But this may be a little bit too beta...

You can use System.Web.Cache (even if you're not in a web context), and that's what I'd do. It's basically a big, in memory hash table with some niceties for expiring contents.

Related