Skip to content

Commit 03e3d97

Browse files
Document Memcached distributed cache factory
1 parent 72e5dfc commit 03e3d97

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

doc/reference/modules/nhibernate_caches.xml

Lines changed: 40 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,43 @@
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+
<para>
793+
The following additional properties can be configured:
794+
</para>
795+
796+
<variablelist>
797+
<varlistentry>
798+
<term><literal>configuration</literal></term>
799+
<listitem>
800+
The JSON configuration of <literal>EnyimMemcachedCore</literal>, see its
801+
<ulink url="https://github.com/cnblogs/EnyimMemcachedCore">project website</ulink>. It has to be structured
802+
like the value part of the <literal>"enyimMemcached"</literal> property in an
803+
<literal>appsettings.json</literal> file.
804+
<example>
805+
<programlisting><![CDATA[{
806+
"Servers": [
807+
{
808+
"Address": "localhost",
809+
"Port": 11211
810+
}
811+
]
812+
}]]></programlisting>
813+
</example>
814+
</listitem>
815+
</varlistentry>
816+
</variablelist>
817+
</section>
818+
781819
<section id="NHibernate.Caches.CoreDistributedCache.Redis">
782820
<title>Redis distributed cache factory</title>
783821

0 commit comments

Comments
 (0)