使用 AppFabric 缓存服务在执行期间更新本地缓存内容

Local Cache contents get updated during execution using AppFabric caching services

我们正在使用启用了本地缓存的 AppFabric 缓存服务。 对数据(从缓存获取)执行的内存操作似乎保存在本地缓存中(没有明确地将更新的对象放入缓存中)。 我在文档中读到的内容是,本地缓存只保存一个本地副本,并且还有使本地缓存无效的机制。 我该怎么做才能覆盖此本地缓存行为(根据我的初步理解,本地缓存内容是只读的,这里似乎不是这种情况) 这是正在使用的配置:

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;

如何覆盖本地缓存的这种行为(由于正在进行大量读取操作,不使用本地缓存不是一种选择)? 提前致谢,

我认为这在 documentation 中有解释(强调已添加):

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

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.