Skip to content

Commit 6cadaf7

Browse files
Document Memcached distributed cache factory
1 parent 2f488cd commit 6cadaf7

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

doc/reference/modules/nhibernate_caches.xml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@
127127
<para>
128128
Uses <classname>Microsoft.Extensions.Caching.Abstractions.IDistributedCache</classname> implementations as the cache
129129
provider. The implementation has to be provided through an <literal>IDistributedCacheFactory</literal>.
130-
Distributed cache factories for <literal>Redis</literal>, <literal>SqlServer</literal> and <literal>Memory</literal>
131-
caches are available through their own package, prefixed by <literal>NHibernate.Caches.CoreDistributedCache.</literal>.
130+
Distributed cache factories for <literal>Memcached</literal>, <literal>Redis</literal>, <literal>SqlServer</literal>
131+
and <literal>Memory</literal> caches are available through their own package, prefixed by
132+
<literal>NHibernate.Caches.CoreDistributedCache.</literal>.
132133
</para>
133134
<para>
134135
This provider is available as a .Net Standard NuGet package. See <xref linkend="NHibernate.Caches.CoreDistributedCache" />.
@@ -778,6 +779,49 @@
778779
cache has no effects with CoreDistributedCache.
779780
</para>
780781

782+
<section id="NHibernate.Caches.CoreDistributedCache.Memcached">
783+
<title>Memcached distributed cache factory</title>
784+
785+
<para>
786+
<literal>NHibernate.Caches.CoreDistributedCache.Memcached</literal> provides a Redis distributed cache factory.
787+
This factory yields a <literal>Enyim.Caching.MemcachedClient</literal> from <literal>EnyimMemcachedCore</literal>.
788+
For using it, reference the cache factory package and set the <literal>factory-class</literal> attribute of the
789+
<literal>coredistributedcache</literal> configuration section to
790+
<literal>NHibernate.Caches.CoreDistributedCache.Memcached.MemcachedFactory, NHibernate.Caches.CoreDistributedCache.Memcached</literal>.
791+
</para>
792+
793+
<para>
794+
Memcached does not support sliding expirations. <literal>cache.use_sliding_expiration</literal> setting or
795+
<literal>sliding</literal> region setting do not have any effect with Memcached.
796+
</para>
797+
798+
<para>
799+
The following additional properties can be configured:
800+
</para>
801+
802+
<variablelist>
803+
<varlistentry>
804+
<term><literal>configuration</literal></term>
805+
<listitem>
806+
The JSON configuration of <literal>EnyimMemcachedCore</literal>, see its
807+
<ulink url="https://github.com/cnblogs/EnyimMemcachedCore">project website</ulink>. It has to be structured
808+
like the value part of the <literal>"enyimMemcached"</literal> property in an
809+
<literal>appsettings.json</literal> file.
810+
<example>
811+
<programlisting><![CDATA[{
812+
"Servers": [
813+
{
814+
"Address": "localhost",
815+
"Port": 11211
816+
}
817+
]
818+
}]]></programlisting>
819+
</example>
820+
</listitem>
821+
</varlistentry>
822+
</variablelist>
823+
</section>
824+
781825
<section id="NHibernate.Caches.CoreDistributedCache.Redis">
782826
<title>Redis distributed cache factory</title>
783827

0 commit comments

Comments
 (0)