|
50 | 50 | <para>
|
51 | 51 | Uses <classname>Bamboo.Prevalence</classname> as the cache provider. Open the
|
52 | 52 | file <filename>Bamboo.Prevalence.license.txt</filename> for more information about its license;
|
53 |
| - you can also visit its <ulink url="http://bbooprevalence.sourceforge.net/">website</ulink>. |
54 |
| - Also see <xref linkend="NHibernate.Caches.Prevalence" />. |
| 53 | + you can also visit its <ulink url="http://bbooprevalence.sourceforge.net/">website</ulink>. This |
| 54 | + provider is available for the .Net Framework only. Also see <xref linkend="NHibernate.Caches.Prevalence" />. |
55 | 55 | </para>
|
56 | 56 | </listitem>
|
57 | 57 | </varlistentry>
|
|
62 | 62 | Uses <classname>System.Web.Caching.Cache</classname> as the cache provider. This means that you can
|
63 | 63 | rely on ASP.NET caching feature to understand how it works. For more information, read (on the MSDN):
|
64 | 64 | <ulink url="https://msdn.microsoft.com/en-us/library/6hbbsfk6.aspx">Caching Application Data</ulink>.
|
65 |
| - Also see <xref linkend="NHibernate.Caches.SysCache" />. |
| 65 | + This provider is available for the .Net Framework only. Also see <xref linkend="NHibernate.Caches.SysCache" />. |
66 | 66 | </para>
|
67 | 67 | </listitem>
|
68 | 68 | </varlistentry>
|
|
75 | 75 | expire when the relevant data in the database changes.
|
76 | 76 | </para>
|
77 | 77 | <para>
|
78 |
| - SysCache2 requires Microsoft SQL Server 2000 or higher. |
| 78 | + SysCache2 requires Microsoft SQL Server 2000 or higher. This provider is available for the .Net Framework only. |
79 | 79 | </para>
|
80 | 80 | <para>
|
81 | 81 | See <xref linkend="NHibernate.Caches.SysCache2" />.
|
|
87 | 87 | <listitem>
|
88 | 88 | <para>
|
89 | 89 | Uses <literal>Memcached</literal>. See <ulink url="https://memcached.org/">memcached homepage</ulink>
|
90 |
| - for more information on Memcached. Also see <xref linkend="NHibernate.Caches.EnyimMemcached" />. |
| 90 | + for more information on Memcached. This provider is available for the .Net Framework only. Also see |
| 91 | + <xref linkend="NHibernate.Caches.EnyimMemcached" />. |
91 | 92 | </para>
|
92 | 93 | </listitem>
|
93 | 94 | </varlistentry>
|
|
106 | 107 | <term><classname>NHibernate.Caches.RtMemoryCache</classname></term>
|
107 | 108 | <listitem>
|
108 | 109 | <para>
|
109 |
| - Uses <classname>System.Runtime.Caching.MemoryCache.Default</classname> as the cache provider. |
110 |
| - See <xref linkend="NHibernate.Caches.RtMemoryCache" />. |
| 110 | + Uses <classname>System.Runtime.Caching.MemoryCache.Default</classname> as the cache provider. This provider |
| 111 | + is available for the .Net Framework only. See <xref linkend="NHibernate.Caches.RtMemoryCache" />. |
| 112 | + </para> |
| 113 | + </listitem> |
| 114 | + </varlistentry> |
| 115 | + <varlistentry> |
| 116 | + <term><classname>NHibernate.Caches.CoreMemoryCache</classname></term> |
| 117 | + <listitem> |
| 118 | + <para> |
| 119 | + Uses <classname>Microsoft.Extensions.Caching.Memory.MemoryCache</classname> as the cache provider. This provider |
| 120 | + is available as a .Net Standard NuGet package. See <xref linkend="NHibernate.Caches.CoreMemoryCache" />. |
111 | 121 | </para>
|
112 | 122 | </listitem>
|
113 | 123 | </varlistentry>
|
|
641 | 651 | </example>
|
642 | 652 | </section>
|
643 | 653 |
|
| 654 | + <section id="NHibernate.Caches.CoreMemoryCache"> |
| 655 | + <title>CoreMemoryCache Configuration</title> |
| 656 | + <para> |
| 657 | + CoreMemoryCache relies on <classname>Microsoft.Extensions.Caching.Memory.MemoryCache</classname> for the |
| 658 | + underlying implementation. |
| 659 | + The following NHibernate configuration settings are available: |
| 660 | + </para> |
| 661 | + |
| 662 | + <variablelist> |
| 663 | + <varlistentry> |
| 664 | + <term><literal>cache.default_expiration</literal></term> |
| 665 | + <listitem> |
| 666 | + Number of seconds to wait before expiring each item. |
| 667 | + Defaults to <literal>300</literal>. It can also be set programmatically on the NHibernate |
| 668 | + configuration object under the name <literal>expiration</literal>, which then takes precedence |
| 669 | + over <literal>cache.default_expiration</literal>. |
| 670 | + </listitem> |
| 671 | + </varlistentry> |
| 672 | + <varlistentry> |
| 673 | + <term><literal>cache.use_sliding_expiration</literal></term> |
| 674 | + <listitem> |
| 675 | + Should the expiration be sliding? A sliding expiration is reinitialized at each get. |
| 676 | + Defaults to <literal>false</literal>. |
| 677 | + </listitem> |
| 678 | + </varlistentry> |
| 679 | + </variablelist> |
| 680 | + |
| 681 | + <para> |
| 682 | + CoreMemoryCache has a config file section handler to allow configuring different expirations for |
| 683 | + different regions, and configuring the <literal>MemoryCache</literal> expiration scan frequency. |
| 684 | + Here is an example: |
| 685 | + </para> |
| 686 | + |
| 687 | + <example> |
| 688 | + <programlisting><![CDATA[<?xml version="1.0" encoding="utf-8" ?> |
| 689 | +<configuration> |
| 690 | + <configSections> |
| 691 | + <section name="corememorycache" |
| 692 | + type="NHibernate.Caches.CoreMemoryCache.CoreMemoryCacheSectionHandler,NHibernate.Caches.CoreMemoryCache" |
| 693 | + /> |
| 694 | + </configSections> |
| 695 | +
|
| 696 | + <corememorycache expiration-scan-frequency="00:05:00"> |
| 697 | + <cache region="foo" expiration="500" /> |
| 698 | + <cache region="bar" expiration="300" sliding="true" /> |
| 699 | + </corememorycache> |
| 700 | +</configuration>]]></programlisting> |
| 701 | + </example> |
| 702 | + </section> |
| 703 | + |
644 | 704 | </chapter>
|
0 commit comments