Search code examples
appfabricappfabric-cache

Windows Server AppFabric Cache Time-out based invalidation callback


I am using Windows Server AppFabric Caching in our application with local cache enabled. This is configured as following:

<localCache isEnabled="true" sync="TimeoutBased" objectCount="1000" ttlValue="120"/>

I have setup time-out based invalidation with time-out interval of 120 seconds. As per this configuration, local cache will remove items from in-memory cache after every 120 seconds and retrieve item from cache cluster. Is it possible to add a callback which gets fired whenever local cache tries to hit the cache cluster to retrieve items instead of fetching them locally?


Solution

  • Unfortunately, there is no way to know if data is fetched locally or not. There are cache server notifications but they are not reliable.

    In your scenario, a good approach could be the Read-Through and Write-Behind feature. It does not fit to all situations but your can take a quick look.

    Here are some links :