|
176 | 176 | </dd></dl></div><p>
|
177 | 177 | SysCache has a config file section handler to allow configuring different expirations and priorities for
|
178 | 178 | different regions. Here is an example:
|
179 |
| - </p><div class="example"><a name="d0e19463"></a><p class="title"><b>Example 27.1. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
| 179 | + </p><div class="example"><a name="d0e19668"></a><p class="title"><b>Example 27.1. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
180 | 180 | <configuration>
|
181 | 181 | <configSections>
|
182 | 182 | <section name="syscache"
|
|
209 | 209 | </dd></dl></div><p>
|
210 | 210 | To configure cache regions with SqlCacheDependencies a <tt class="literal">syscache2</tt> config section must be
|
211 | 211 | defined in the application's configuration file. See the sample below.
|
212 |
| - </p><div class="example"><a name="d0e19514"></a><p class="title"><b>Example 27.2. </b></p><pre class="programlisting"> |
| 212 | + </p><div class="example"><a name="d0e19719"></a><p class="title"><b>Example 27.2. </b></p><pre class="programlisting"> |
213 | 213 | <configSections>
|
214 | 214 | <section name="syscache2"
|
215 | 215 | type="NHibernate.Caches.SysCache2.SysCacheSection, NHibernate.Caches.SysCache2"/>
|
|
224 | 224 | </p><p>
|
225 | 225 | To configure the data in a cache region to be invalidated when data in an underlying table is changed,
|
226 | 226 | a cache region must be configured in the application's configuration file. See the sample below.
|
227 |
| - </p><div class="example"><a name="d0e19527"></a><p class="title"><b>Example 27.3. </b></p><pre class="programlisting"><syscache2> |
| 227 | + </p><div class="example"><a name="d0e19732"></a><p class="title"><b>Example 27.3. </b></p><pre class="programlisting"><syscache2> |
228 | 228 | <cacheRegion name="Product">
|
229 | 229 | <dependencies>
|
230 | 230 | <tables>
|
|
256 | 256 | </p><p>
|
257 | 257 | To configure the data in a cache region to be invalidated based on a SQL command, a cache region must
|
258 | 258 | be configured in the application's configuration file. See the samples below.
|
259 |
| - </p><div class="example"><a name="d0e19572"></a><p class="title"><b>Example 27.4. Stored Procedure</b></p><pre class="programlisting"><cacheRegion name="Product" priority="High" > |
| 259 | + </p><div class="example"><a name="d0e19777"></a><p class="title"><b>Example 27.4. Stored Procedure</b></p><pre class="programlisting"><cacheRegion name="Product" priority="High" > |
260 | 260 | <dependencies>
|
261 | 261 | <commands>
|
262 | 262 | <add name="price"
|
263 | 263 | command="ActiveProductsStoredProcedure"
|
264 | 264 | isStoredProcedure="true"/>
|
265 | 265 | </commands>
|
266 | 266 | </dependencies>
|
267 |
| -</cacheRegion></pre></div><div class="example"><a name="d0e19577"></a><p class="title"><b>Example 27.5. SELECT Statement</b></p><pre class="programlisting"><cacheRegion name="Product" priority="High"> |
| 267 | +</cacheRegion></pre></div><div class="example"><a name="d0e19782"></a><p class="title"><b>Example 27.5. SELECT Statement</b></p><pre class="programlisting"><cacheRegion name="Product" priority="High"> |
268 | 268 | <dependencies>
|
269 | 269 | <commands>
|
270 | 270 | <add name="price"
|
|
287 | 287 | </dd></dl></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="NHibernate.Caches.SysCache2-Aggregate"></a>27.5.3. Aggregate Dependencies</h3></div></div><div></div></div><p>
|
288 | 288 | Multiple cache dependencies can be specified. If any of the dependencies triggers a change
|
289 | 289 | notification, the data in the cache region will be invalidated. See the samples below.
|
290 |
| - </p><div class="example"><a name="d0e19638"></a><p class="title"><b>Example 27.6. Multiple commands</b></p><pre class="programlisting"><cacheRegion name="Product"> |
| 290 | + </p><div class="example"><a name="d0e19843"></a><p class="title"><b>Example 27.6. Multiple commands</b></p><pre class="programlisting"><cacheRegion name="Product"> |
291 | 291 | <dependencies>
|
292 | 292 | <commands>
|
293 | 293 | <add name="price"
|
|
297 | 297 | command="Select quantityAvailable from dbo.VideoAvailability"/>
|
298 | 298 | </commands>
|
299 | 299 | </dependencies>
|
300 |
| -</cacheRegion></pre></div><div class="example"><a name="d0e19643"></a><p class="title"><b>Example 27.7. Mixed</b></p><pre class="programlisting"><cacheRegion name="Product"> |
| 300 | +</cacheRegion></pre></div><div class="example"><a name="d0e19848"></a><p class="title"><b>Example 27.7. Mixed</b></p><pre class="programlisting"><cacheRegion name="Product"> |
301 | 301 | <dependencies>
|
302 | 302 | <commands>
|
303 | 303 | <add name="price"
|
|
315 | 315 | for each item added to the cache. Time based expiration policies will not invalidate the data
|
316 | 316 | dependencies for the whole cache region, but serve as a way to remove items from the cache after they
|
317 | 317 | have been in the cache for a specified amount of time. See the samples below.
|
318 |
| - </p><div class="example"><a name="d0e19653"></a><p class="title"><b>Example 27.8. Relative Expiration</b></p><pre class="programlisting"><cacheRegion name="Product" relativeExpiration="300" priority="High" useSlidingExpiration="true" /></pre></div><div class="example"><a name="d0e19658"></a><p class="title"><b>Example 27.9. Time of Day Expiration</b></p><pre class="programlisting"><cacheRegion name="Product" timeOfDayExpiration="2:00:00" priority="High" /></pre></div><div class="variablelist"><p class="title"><b>Additional Configuration Properties</b></p><dl><dt><span class="term"><tt class="literal">relativeExpiration</tt></span></dt><dd><p> |
| 318 | + </p><div class="example"><a name="d0e19858"></a><p class="title"><b>Example 27.8. Relative Expiration</b></p><pre class="programlisting"><cacheRegion name="Product" relativeExpiration="300" priority="High" useSlidingExpiration="true" /></pre></div><div class="example"><a name="d0e19863"></a><p class="title"><b>Example 27.9. Time of Day Expiration</b></p><pre class="programlisting"><cacheRegion name="Product" timeOfDayExpiration="2:00:00" priority="High" /></pre></div><div class="variablelist"><p class="title"><b>Additional Configuration Properties</b></p><dl><dt><span class="term"><tt class="literal">relativeExpiration</tt></span></dt><dd><p> |
319 | 319 | Number of seconds that an individual item will exist in the cache before being removed.
|
320 | 320 | Defaults to <tt class="literal">300</tt> if neither <tt class="literal">relativeExpiration</tt> nor
|
321 | 321 | <tt class="literal">timeOfDayExpiration</tt> are defined, and if no expiration settings are
|
|
351 | 351 | </dd></dl></div><p>
|
352 | 352 | RtMemoryCache has a config file section handler to allow configuring different expirations for
|
353 | 353 | different regions. Here is an example:
|
354 |
| - </p><div class="example"><a name="d0e19755"></a><p class="title"><b>Example 27.10. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
| 354 | + </p><div class="example"><a name="d0e19960"></a><p class="title"><b>Example 27.10. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
355 | 355 | <configuration>
|
356 | 356 | <configSections>
|
357 | 357 | <section name="rtmemorycache"
|
|
513 | 513 | </dd></dl></div><p>
|
514 | 514 | NHibernate.Caches.StackExchangeRedis has a config file section handler to allow configuring different expirations for
|
515 | 515 | different regions. Here is an example:
|
516 |
| - </p><div class="example"><a name="d0e20159"></a><p class="title"><b>Example 27.11. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
| 516 | + </p><div class="example"><a name="d0e20364"></a><p class="title"><b>Example 27.11. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
517 | 517 | <configuration>
|
518 | 518 | <configSections>
|
519 | 519 | <section name="redis"
|
|
547 | 547 | CoreMemoryCache has a config file section handler to allow configuring different expirations for
|
548 | 548 | different regions, and configuring the <tt class="literal">MemoryCache</tt> expiration scan frequency.
|
549 | 549 | Here is an example:
|
550 |
| - </p><div class="example"><a name="d0e20209"></a><p class="title"><b>Example 27.12. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
| 550 | + </p><div class="example"><a name="d0e20414"></a><p class="title"><b>Example 27.12. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
551 | 551 | <configuration>
|
552 | 552 | <configSections>
|
553 | 553 | <section name="corememorycache"
|
|
589 | 589 | different regions, configuring the <tt class="literal">IDistributedCacheFactory</tt> to use, and configuring
|
590 | 590 | additional properties specific to the chosen <tt class="literal">IDistributedCache</tt> implementation.
|
591 | 591 | Here is an example:
|
592 |
| - </p><div class="example"><a name="d0e20283"></a><p class="title"><b>Example 27.13. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
| 592 | + </p><div class="example"><a name="d0e20488"></a><p class="title"><b>Example 27.13. </b></p><pre class="programlisting"><?xml version="1.0" encoding="utf-8" ?> |
593 | 593 | <configuration>
|
594 | 594 | <configSections>
|
595 | 595 | <section name="coredistributedcache"
|
|
634 | 634 | <a href="https://github.com/cnblogs/EnyimMemcachedCore" target="_top">project website</a>. It has to be structured
|
635 | 635 | like the value part of the <tt class="literal">"enyimMemcached"</tt> property in an
|
636 | 636 | <tt class="literal">appsettings.json</tt> file.
|
637 |
| - <div class="example"><a name="d0e20350"></a><p class="title"><b>Example 27.14. </b></p><pre class="programlisting">{ |
| 637 | + <div class="example"><a name="d0e20555"></a><p class="title"><b>Example 27.14. </b></p><pre class="programlisting">{ |
638 | 638 | "Servers": [
|
639 | 639 | {
|
640 | 640 | "Address": "localhost",
|
|
0 commit comments