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

Evaluate @Cacheable(condition) once per method invocation only [SPR-17024] #21562

Closed
spring-projects-issues opened this issue Jul 9, 2018 · 1 comment
Assignees
Labels
in: core type: enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 9, 2018

George Georgovassilis opened SPR-17024 and commented

Cacheable(condition) is evaluated twice for every invocation on the proxied object. For a failing test see https://github.com/ggeorgovassilis/spring-cache-double-condition-evaluation/tree/master

This is a potential performance bottleneck as conditions may delegate to objects which query a database or perform costly cryptographic operations.


Affects: 5.0.7

Reference URL: https://github.com/ggeorgovassilis/spring-cache-double-condition-evaluation/tree/master

Referenced from: commits faef363

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 16, 2018

Juergen Hoeller commented

Good point! We're caching the evaluation result per cache operation now.

@spring-projects-issues spring-projects-issues added type: enhancement in: core labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.1 RC1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants