【发布时间】:2011-10-18 02:43:26
【问题描述】:
我们正在使用 Nhibernate 和二级缓存(非严格读写)。使用 NH Profiler 分析应用程序时,我可以看到数据被请求一次。但是如果网络应用程序空闲,几分钟后,在第一次请求时,再次请求数据......缓存是否有一些过期日期/超时?如何防止缓存被清除?
【问题讨论】:
标签: c# asp.net nhibernate second-level-cache
我们正在使用 Nhibernate 和二级缓存(非严格读写)。使用 NH Profiler 分析应用程序时,我可以看到数据被请求一次。但是如果网络应用程序空闲,几分钟后,在第一次请求时,再次请求数据......缓存是否有一些过期日期/超时?如何防止缓存被清除?
【问题讨论】:
标签: c# asp.net nhibernate second-level-cache
假设您使用的是 SysCache:
<configuration>
<configSections>
<section name="syscache" type="NHibernate.Caches.SysCache.SysCacheSectionHandler,NHibernate.Caches.SysCache" />
</configSections>
<syscache>
<cache region="foo" expiration="500" priority="4" />
<cache region="bar" expiration="300" priority="3" />
</syscache>
</configuration>
【讨论】: