I\'m trying to implement Spring 3.1 caching as explained here and here, but it doesn\'t seem to be working: my method is run through every time even though it is marked @cacheab
From http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/html/cache.html
In proxy mode (which is the default), only external method calls coming in through the proxy are intercepted. This means that self-invocation, in effect, a method within the target object calling another method of the target object, will not lead to an actual caching at runtime even if the invoked method is marked with @Cacheable - considering using the aspectj mode in this case.
and
Method visibility and
@Cacheable
/@CachePut
/@CacheEvict
When using proxies, you should apply the
@Cache
annotations only to methods with public visibility.
someMethod
in the same target object. @Cacheable
method is not public.