Reputation: 6483
Is it possible to have 'Cache Dependencies' in AppFabric, or any other distributed cache system, similar to what you can do using the HttpRuntime cache of ASP.Net, using the CacheDependency
class?
The scope of this is to have say a UserControl attached to a 'key' of the cache. If the cache entry changes, the usercontrol is invalidated and re-loads itself. Is this possible?
Upvotes: 1
Views: 722
Reputation: 6483
After some research and testing - AppFabric does support something similar to the above, which are called 'Cache Notification Callbacks'. Basicaly, you can attach to items/regions of the cache, and the system will raise events when the cache is changed.
However such notifications are not instant, and use a 'polling' mechanism. This is something which one must keep in mind, as at first I was thinking that the system is not working. The default polling is 300seconds (5 minutes), so it might take some "time" to get the notification. This can be changed to any other interval, and especially for testing.
I've tried this out and can confirm its working. Details on how to implement can be found on the MSDN link: http://msdn.microsoft.com/en-us/library/ee808091(v=azure.10).aspx
Upvotes: 1