Skip to content

Explicit how to use advanced Redis strategies #3429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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