Re: CacheableAction always regenerated
Status: Inactive
Brought to you by:
fgnass
|
From: Felix G. <fel...@ne...> - 2004-02-07 11:06:24
|
Hi Martin, if you don't subclass AbstractCacheableAction, you have to call cacheItem.setLastModified() in your getLastModified method. Just have a look at AbstractCacheableAction to how its done there. This way it's possible to implement time-based caching, that prevents the execution of an expensive getLastModified() method (database calls etc.) for a certain amount of time. I think we should change the way isNew() works, to allow a straight forward implementation of getLastModified(). Thanks for your feedback Martin! ~felix Martin Alley wrote: >Hi, > >I am using actioncache v 1.1.1 > >I want to take the shortest route to getting cached output in my struts >based project, so I have make my Action implement CacheableAction. > >The code still runs, and serves the page okay, but the content is still >be generated each time, not served from the cache. > >I have looked at ActionCacheRequestProcessor.processActionPerform, and >this is what I see: >The items are being put in the cache, and found next time they are >needed (AbstractCache.getItem is calling touch(item)), but back in >ActionCacheRequestProcessor.processActionPerform, cacheItem.isNew() is >true, because lastModified is NOT_YET. > >I cannot see where ActionCacheItem.setLastModified is called. > >Can anyone help? >Thanks >Martin > > |