Skip to content

Commit

Permalink
Explicit how to use advanced Redis strategies (#3429)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericDelaporte authored Sep 18, 2023
1 parent 98d170a commit 7a86566
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions doc/reference/modules/nhibernate_caches.xml
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,14 @@
Extends <literal>NHibernate.Caches.StackExchangeRedis.DefaultRegionStrategy</literal> and uses
an additional local memory cache for faster readings. The local caches are invalidated by using Redis pub/sub mechanism.
This strategy should be used only for regions that have few write operations and a high expiration time.
</para>
<para>
In order to use this strategy a custom <literal>ICacheRegionStrategyFactory</literal>
has to be provided (see <literal>cache.region_strategy_factory</literal> setting), where the strategy is created with a
custom <literal>RegionMemoryCacheBase</literal> implementation. See the source of
<literal>NHibernate.Caches.StackExchangeRedis.Tests.CacheRegionStrategyFactory</literal> for an example.
</para>
<para>
This strategy inherits additional settings from <literal>DefaultRegionStrategy</literal> and also has its own settings:
<varlistentry>
<term><literal>cache.region_strategy.two_layer_cache.use_pipelining</literal></term>
Expand Down Expand Up @@ -848,7 +856,16 @@
Extends <literal>NHibernate.Caches.StackExchangeRedis.FastRegionStrategy</literal> and uses
an additional local memory cache for faster readings. The local caches are invalidated by using Redis pub/sub mechanism.
This strategy does not support <literal>ICache.Clear</literal> operation and should be used only for regions that have
few write operations and a high expiration time. This strategy has additional settings:
few write operations and a high expiration time.
</para>
<para>
In order to use this strategy a custom <literal>ICacheRegionStrategyFactory</literal>
has to be provided (see <literal>cache.region_strategy_factory</literal> setting), where the strategy is created with a
custom <literal>RegionMemoryCacheBase</literal> implementation. See the source of
<literal>NHibernate.Caches.StackExchangeRedis.Tests.CacheRegionStrategyFactory</literal> for an example.
</para>
<para>
This strategy has additional settings:
<varlistentry>
<term><literal>cache.region_strategy.fast_two_layer_cache.use_pipelining</literal></term>
<listitem>
Expand Down Expand Up @@ -880,9 +897,16 @@
operation was performed. When two operations have the same <literal>DateTime.Ticks</literal>, then the client with the highest
id wins. This strategy should be used only for regions that have few write operations and a high expiration time. It is recommended
to use <literal>NHibernate.Caches.StackExchangeRedis.TwoLayerCacheRegionStrategy</literal>, when the instances where the strategy
would run are often restarted/recycled. In order to use this strategy a custom <literal>ICacheRegionStrategyFactory</literal>
has to be provided (see <literal>cache.region_strategy_factory</literal> setting), where the strategy is created with a custom
<literal>RegionMemoryCacheBase</literal> implementation. This strategy has additional settings:
would run are often restarted/recycled.
</para>
<para>
In order to use this strategy a custom <literal>ICacheRegionStrategyFactory</literal>
has to be provided (see <literal>cache.region_strategy_factory</literal> setting), where the strategy is created with a
custom <literal>RegionMemoryCacheBase</literal> implementation. See the source of
<literal>NHibernate.Caches.StackExchangeRedis.Tests.CacheRegionStrategyFactory</literal> for an example.
</para>
<para>
This strategy has additional settings:
<varlistentry>
<term><literal>cache.region_strategy.distributed_local_cache.use_pipelining</literal></term>
<listitem>
Expand Down

0 comments on commit 7a86566

Please sign in to comment.