Question

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?

Was it helpful?

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 :

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top