ドキュメントには、
/// The cache manager must have at least one cache handle configured with <see cref="CacheHandleConfiguration.IsBackplaneSource"/> set to <c>true</c>.
/// Usually this is the redis cache handle, if configured. It should be the distributed and bottom most cache handle.
Cachemanager の Web サイトで例として示されているため、RedisCacheHandle でそれを行う方法を知っています。
var cache = CacheFactory.Build<int>("myCache", settings =>
{
settings
.WithSystemRuntimeCacheHandle("inProcessCache")
.And
.WithRedisConfiguration("redis", config =>
{
config.WithAllowAdmin()
.WithDatabase(0)
.WithEndpoint("localhost", 6379);
})
.WithMaxRetries(1000)
.WithRetryTimeout(100)
.WithRedisBackplane("redis")
.WithRedisCacheHandle("redis", true);
});
問題は、キャッシュ リソースとして Redis を使用したくないことです。Redis Pub/Sub メカニズムの力で分散キャッシュを作成したいだけです。コードを介したデバッグによると、Redis バックプレーン機能を使用することで、実際に Redis との間でメッセージを送受信できます。では、なぜ RedisCacheHandle を使用せず、代わりに SystemRuntimeCacheHandle を使用するのでしょうか?
したがって、私の期待は、次のキャッシュ構成で正常に実行されることでした
var cache = CacheFactory.Build<int>("myCache", settings =>
{
settings
.WithSystemRuntimeCacheHandle("inProcessCache")
.And
.WithRedisConfiguration("redis", config =>
{
config.WithAllowAdmin()
.WithDatabase(0)
.WithEndpoint("localhost", 6379);
})
.WithMaxRetries(1000)
.WithRetryTimeout(100)
.WithRedisBackplane("redis")
.WithSystemRuntimeCacheHandle("inProcessCache", true);
});
しかし、それは機能していません。解決策を教えてください。私は何を間違っていますか?または、ドキュメントに次のように書かれていますが、
...通常、これは redis キャッシュ ハンドルです...
RedisCacheHandle なしでキャッシュ同期機能を使用する方法はありますか?