Read-Through
NCache framework will use your custom read-through provider to communicate with the back-end data source. Here, you have to implement your custom logic to load data from the configured data source. NCache will call your provider to load data from the data source behind the get call, in case of a cache miss.
Read-Through provider can be configured in following ways:
Add/Remove Read Thru Providers
For NCache Professional Edition, you can add read-thru providers using the Windows PowerShell tools.
Step 1: Stop Cache
Stop the cache on all servers before updating the cache settings through Windows PowerShell using the Stop-Cache cmdlet.
Stop-Cache -Name demoClusteredCache
Step 2:
Add Read-Thru Providers
Add the read through providers using the Add-BackingSource cmdlet.
The following example adds read-thru provider sqlreader
to the cache demoClusteredCache.
Add-BackingSource -CacheName demoClusteredCache -AssemblyPath C:\ReadThru.dll -Class ReadThru.Reader -ProviderName sqlreader -ReadThru
Remove Read-Thru Providers
Remove-BackingSource cmdlet removes the pre-configured read-thru from the cache.
The following example removes the pre-configured read-thru providers named sqlreader
from the cache demoClusteredCache.
Remove-BackingSource -CacheName demoClusteredCache -ProviderName sqlreader –ReadThru
Step 3: Start Cache
Start the cache on all servers through Windows PowerShell using the Start-Cache cmdlet.
Start-Cache -Name demoClusteredCache
See Also
Write Through/ Write-Behind
Configure Query Indexes
PowerShell Tools