NCache 4.3 - Online Documentation

Read-through Cache Provider

 
NOTE: This feature is not available in NCache Express and Professional edition.
 
Namespace:
 
For enabling Read-through caching, you need reference of the following assembly in your application:
Alachisoft.NCache.Runtime.dll
This assembly contains class implementing Alachisoft.NCache.Runtime.DatasourceProviders.IReadThruProvider interface provided by NCache. The class implementing this interface gets the notification requests to load the data from the master datasource if its not available in the cache. Thus, the class needs to include the logic for loading the data from the datasource to the cache.
Following namespaces are required in your project for using Read-Thru provider:
 
using Alachisoft.NCache.Web.Caching;
using Alachisoft.NCache.Runtime.DatasourceProviders;
using Alachisoft.NCache.Runtime;
 
Read-Through Interfaces:
 
In order to use Read-Thru cache provider in your application, implement the following methods:
 
public  void Init(System.Collections.IDictionary parameters, String cacheId);
public void Dispose();
public  void LoadFromSource(string key, out ProviderCacheItem cacheItem);
public Dictionary <string, ProviderCacheItem> LoadFromSource(string [] keys);
 
 
See Also
 
© Copyright  2014 Alachisoft. All rights reserved.