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
Add conditional caching with the new EL #572
Labels
type: enhancement
New feature or request
Comments
@timyates lets explore this for Micronaut Framework 4.3.0 |
@graemerocher @sdelamo Do you have thoughts on what would conditional caching with the new EL look like? I'm unsure as to how to progress 🤔 |
Example: @Cacheable(name="fruit", condition="#{name != 'banana')}")
Fruit getFruit(String name) {
} |
timyates
added a commit
that referenced
this issue
Nov 15, 2023
This adds a conditional field to `@Cacheable`, `@CachePut` and `@CacheInvalidate`. Whenever the cache interceptor is invoked via a method annotated with one of these, the conditional is evaluated to a boolean as to whether caching should be performed. As this would slow down existing apps, or those not using conditional, we check to see if the annotations contain a conditional, and if not the additional processing is shortcircuited to go back to the old behavior. Closes #572
sdelamo
pushed a commit
that referenced
this issue
Nov 20, 2023
This adds a conditional field to `@Cacheable`, `@CachePut` and `@CacheInvalidate`. Whenever the cache interceptor is invoked via a method annotated with one of these, the conditional is evaluated to a boolean as to whether caching should be performed. As this would slow down existing apps, or those not using conditional, we check to see if the annotations contain a conditional, and if not the additional processing is shortcircuited to go back to the old behavior. Closes #572
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See micronaut-projects/micronaut-core#8954
The text was updated successfully, but these errors were encountered: