Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dynamic values in @Cacheable and @CacheEvict [SPR-10778] #15405

spring-issuemaster opened this issue Jul 24, 2013 · 1 comment


None yet
2 participants
Copy link

commented Jul 24, 2013

Thomas Struntz opened SPR-10778 and commented

@Cacheable and @CacheEvict only take a constant value for the cache names. Allow it to be a dynamic value: class field, value from properties file eg ${myProperty} like in @Value or a SpEL expression.

In case of abstract classes that implement methods that should be cached but each subclass should use a different cache name. This is not possible currently and hence such methods can not be put into an abstract class even though all subclasses use exactly the same method.

Affects: 3.1.4

2 votes, 3 watchers


This comment has been minimized.

Copy link
Collaborator Author

commented Dec 22, 2015

Stéphane Nicoll commented

The cache abstraction supports the CacheResolver abstraction now and it can be specified globally, per class and/or on a specific operation. The CacheResolver give you the ability to compute the caches to use in code so you have all the flexibility that you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.