Search code examples
c#.netcachingdistributedncache

Difference between Web.Cache and ObjectCacheProvider of Ncache


I am planning to use Ncache for caching application data in distributed applications.

I am able to cache data using ObjectCacheProvider and NCache.Initiaize('cacheName') i.e Web.Cache.

What's the difference between them??


Solution

  • Object cache provide is just an integration for System.Runtime.Caching Namespace and as it says:

    The System.Runtime.Caching namespace contains types that let you implement caching in NET Framework applications.

    It basically allows you to switch to other caching platforms (which there are not many) with minimum code change.

    Use the web api (below) to be able to use more features of NCache otherwise stick to object cache provider.

    NCache.Initiaize('cacheName')