I need to use several caches in my service for different uses. I'm looking for a way to separate their configurations like maximumSize and expireAfterWrite. I'm using Spring and Kubernetes, and in the deploy.yaml I have this:
spring:
main:
allow-bean-definition-overriding: true
cache:
type: CAFFEINE
cache-names: cacheA, cacheB
caffeine:
spec: expireAfterWrite=1h,maximumSize=2000
output:
ansi:
enabled: never
I want to create a new cache, cacheC, which will have a different configurations.
How can I do that? Thanks!
You can declare many cache configurations programmatically instead of using yaml.
Something like this: