spring cache expire using bean property
问题 Is there a way of indicating to expire/evict the cache object based on a property of the POJO cached. In below code, it caches Foo instance. Foo class has a expiresIn property class Foo { Date expiresIn; } I want to hint to spring to expire the cache based on the value of expiresIn property of cached element. Is this feasible? @Cacheable("my-cache-key") Foo getCachedToken(String userName, String password) throws AuthException My Cache.xml is below: <cache:annotation-driven/> <bean id=