Client Side WCF Caching with .NET4

I have a set of objects that will be retrieved from a service. Some of them are static, so I decided to create a client side cache. But I can't seem to find the point to insert caching. I have svcutil generated proxies and I need to enable caching for some of them (not all). I want to make some kind of mechanism that will work at the channelFactory / clientBase level and will cache all the required entities.

What I want:

  • transparent caching without changing business logic (at all or at all)

  • setting up cached objects with some attribute: [Cacheable]

  • the ability to add a caching implementation: MemoryCache, DistributedCache

+1


source to share


2 answers


While it is very easy to create a caching attribute using IOperationInvoker

in a service (see an example here ), it is very difficult to do the same on the client side.



The best example I've seen is Paolo Salvatori, available here . Great solution, but I finally gave up due to the complexity. I switched to a generic wrapper for WCF calls. There are also manual tasks, but it is easier and I can manage it easily.

+1


source


how about caching with the Castle Windsor integration tool? you can intercept and implement the client side of the cache (I did this). Weak side: I think this project is poorly documented and also I really don't know how alive it is.



http://docs.castleproject.org/Windsor.WCF-Integration-Facility.ashx

0


source







All Articles