The data loaded in the cache using Cache Loader needs to be synced with the updated data in the data source. For this, the datasets need to be scheduled for refreshing. Besides the scheduled refresh interval, NCache allows the user to manually refresh a pre-configured dataset at runtime when desired.
This can be done either through the Web Manager or through PowerShell cmdlet.
- Make sure that Cache Loader and Refresher is successfully configured and deployed using NCache Web Manager or PowerShell cmdlet and cache is running.
Using NCache Web Manager
Launch NCache Web Manager by browsing to http://localhost:8251 or
<server-ip>:8251on Windows and Linux.
In the left navigation bar, click on Clustered Caches or Local Caches, based on the cache.
Against the cache name, click on View Details.
- This opens up the detailed configuration page for the cache. Go to the Advanced Settings tab and click on Cache Loader / Refresher in the left bar. Under the Datasets section click the Refresh Now option. You will receive a success notification if the refresher is successfully invoked.
The invoke refresher option is enabled when the cache is running.
Invoke-RefresherDataset cmdlet enables the user to refresh a pre-configured dataset at runtime. The user can either refresh their datasets immediately or within the next 24 hours using the
RefreshPreference option of this cmdlet. However, if all the nodes are busy refreshing other datasets, then the new datasets are refreshed in the refresh interval when any node is free.
- The following command refreshes the dataset product immediately on demoClusteredCache on server 22.214.171.124.
Invoke-RefresherDataset -CacheName demoClusteredCache -Server 126.96.36.199 -Dataset product -RefreshPreference RefreshNow
- This command refreshes the dataset product at the configured time of the dataset on demoClusteredCache within the next 24 hours. If the dataset specified will be a load only dataset, its preference will be treated as same as
Invoke-RefresherDataset -CacheName demoClusteredCache -Server 188.8.131.52 -Dataset product -RefreshPreference RefreshOnNextTimeOfDay