2013-05-30 74 views
1

使用Grails ehcache插件時,我試圖緩存響應並偶爾刷新響應。Grails cache-ehache無法正常工作

這是我在我的Config.groovy中,

cache { 
    name 'userprojects' 
    eternal false 
    timeToIdleSeconds 60 
    timeToLiveSeconds 60 
    memoryStoreEvictionPolicy 'LRU' 

} 

而且我的註釋獲獎者@Cacheable( 'userprojects')端點。

我看到響應得到緩存,但我從來沒有看到緩存過期。任何人有任何線索可能會發生什麼?

ehcache.EhcachePageFragmentCachingFilter響應ok。添加到緩存userprojects與關鍵GET:/ CompositeWeb/userMapping/userProjects jiraInstance_id = 1和TTL 2147483647

這裏TTL總是被設置爲最大值,而不是60,我配置?

+0

相關[問題](http://stackoverflow.com/questions/12415029/grails-cache-ehcache -plugin-and-ttl-values)以及其他詳細信息: – cweston

回答

2

我遇到同樣的問題,我想我「已經找到了解決辦法。我打開下面的JIRA http://jira.grails.org/browse/GPCACHEEHCACHE-6,並將在週末提交pull請求。我測試了當地我的變化,他們工作得很好。

問題在於put()調用不使用緩存的TTL,而是使用默認值。