使EHCache使尚未以特定方式访问的元素过期

| 我试图让EHCache将缓存元素标记为已过期,如果在指定的时间内未以特定方式访问它们。 我有一个自动的缓存刷新器,该刷新器应刷新缓存中的元素,而不更新上次访问的时间。它定期运行。但是,如果用户通过应用程序从缓存中请求某些内容,则应更新最后访问的时间。一周的用户不活动后,元素应过期并从缓存中删除。 EHCache是​​否已准备就绪,可以解决此类问题?我看到了putQuiet和getQuiet方法,但是我没有看到任何明确提及它们不更新上次访问时间的方法。另外,timeToLiveSeconds和timeToIdleSeconds参数之间是否有真正的区别? 谢谢, 麦克风     
已邀请:
 timeToIdleSeconds:
Sets the time to idle for an element before it expires.
i.e. The maximum amount of time between accesses before an element expires
Is only used if the element is not eternal.
Optional attribute. A value of 0 means that an Element can idle for infinity.
The default value is 0.

timeToLiveSeconds:
Sets the time to live for an element before it expires.
i.e. The maximum time between creation time and when an element expires.
Is only used if the element is not eternal.
Optional attribute. A value of 0 means that and Element can live for infinity.
The default value is 0.
有关其他属性,请参阅ehcache软件包随附的ehcache.xml。您可以使用带有参数的Cache构造函数实例化您的缓存,然后缓存将自行管理     

要回复问题请先登录注册