0
votes

We are using AppFabric Caching services with local cache enabled. the in-memory operations being performed on data (acquired from Cache) seem to be getting saved in local cache (without explicitly placing the updated objects in cache). What I've read in documentation, local cache just holds a local copy and there are mechanisms to invalidate local Cache as well. What can I do in order to over-write this local-cache behavior (as per my initial understanding, local-cache contents are read-only, which does not seem the case here) this the configuration being used:

DataCacheFactoryConfiguration configuration = new DataCacheFactoryConfiguration();
        configuration.TransportProperties.MaxBufferSize = int.MaxValue;
        configuration.TransportProperties.MaxBufferPoolSize = long.MaxValue;
        configuration.MaxConnectionsToServer = MaxConnectionsToServer;
        DataCacheServerEndpoint server = new DataCacheServerEndpoint(host, port);
        List<DataCacheServerEndpoint> servers = new List<DataCacheServerEndpoint>();
        servers.Add(server);
        configuration.Servers = servers;
        DataCacheLocalCacheProperties localCacheProperties = new DataCacheLocalCacheProperties(MaxObjectCount, LocalCacheTimeout, DataCacheLocalCacheInvalidationPolicy.TimeoutBased);
        configuration.LocalCacheProperties = localCacheProperties;

How can I overwrite this behavior of local cache (not using local cache is not an option due to lot of read operations going on) ? Thanks in advance,

1

1 Answers

1
votes

I think this is explained in the documentation (emphasis added):

Locally cached objects are stored within the same process space as the cache client process. When a cache client requests a locally cached object, the client receives a reference to the locally cached object rather than a copy

and

After objects are stored in the local cache, your application continues to use those objects until they are invalidated, regardless of whether those objects are updated by another client on the cache cluster. For this reason, it is best to use local cache for data that changes infrequently.