Custom Data Source Dependency
NCache provides flexible ways to determine data invalidation using various dependencies. However, you can implement your custom logic for dependency if none of the built in invalidation strategies suit your environment. For example, you can implement a custom dependency which makes a call to a web service for the validation of data.
In custom dependency, you can implement your custom logic which defines when a
certain data becomes invalid. For this purpose, NCache provides an abstract
class ExtensibleDependency
. All you need to do is to inherit your dependency
class from this class and override its HasChanged
property.
Once implemented, place the assembly or executable file of class overriding
ExtensibleDependency
in NCache service folder and restart the NCache service.
Like expiration, cache clean up thread periodically
calls HasChanged()
property of custom dependency and if it returns, the true
item is removed from the cache.
For more details, please read Custom Cache Dependency in section Server Side API Programming.