NHibernate.Caches.MemCache web.config for cache expiration time

元气小坏坏 提交于 2019-12-03 21:29:56

Use expiration.

<property name="expiration" >YOUR_INTERVAL_IN_SECONDS</property>

After that, when you run app with logging you can see:

NHibernate.Caches.MemCache.MemCacheClient: 20:57:55,762 DEBUG MemCacheClient:0 - using expiration of YOUR_INTERVAL_IN_SECONDS seconds

Use default_expiration.

<property name="default_expiration" >YOUR_INTERVAL_IN_SECONDS</property>

I have seen in the source that the default expiration value is set to 300 second. But you can override this value by setting default_expiration property form the NHibernate configuration file.

As far as I understand, the cache expiry time is provider specific as some cache providers don't support this. Also, it means that you don't have the situation where a value of 60 means an hour in some cases and a minute in others.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!