When you are using NCache for AppData caching, then most common option is to use Cache Aside approach where data naturally gets added. Initially, this slows down the process, when you have no data in the cache. As a result, a lot of requests go to the database until you have the cache filled up. To avoid this slowness due to lack of data in the cache, NCache provides Cache Startup Loader feature which runs each time you start your cache and fills up the needed data (working set) in the cache from the database.
Similarly, there can be a situation where you have new data being added or getting updated in the database. In order to avoid stale data in the cache, you need to refresh the already loaded data in the cache either on demand or based on some schedule. Therefore, NCache gives Cache Refresher feature to refresh cache data and keep it synced with the database.
Now to implement the Cache Startup Loader and Refresher feature and get to know how a cache can be preloaded with data on cache startup instead of manual addition, follow the steps given below.
You can configure Cache Startup Loader and Refresher in the following two ways:
Using NCache Web Manager you can observe the cache count and with PowerShell, you can execute the following command to check if data has been added in the cache on startup.
Get-CacheCount –Name demoCache
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.