我们正在使用 Nhibernate 和二级缓存(非严格读写)。使用 NH Profiler 分析应用程序时,我可以看到数据被请求一次。但是,如果网络应用程序空闲,几分钟后,在第一次请求时,会再次请求数据......缓存上是否有一些过期日期/超时?我应该怎么做才能防止缓存被清除?
最佳答案
假设您使用 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>
关于c# - NHibernate:二级缓存过期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6910078/