I am experimenting Cache in Spring Boot. At moment, I am using Caffeine implementation. From what I've read from the documentation, I've configured the caches in YAML as follows:
spring:
cache:
cache-names:
- skills
- profile-level-type
caffeine:
spec: maximumSize=50,expireAfterAccess=60s
Where skills
and profile-level-type
correspond to different @Service
s. It is working. However I would like something that more flexible. Apparently, I cannot make a configuration to a specific cache. I was thinking something about this:
spring:
cache:
caffeine:
skills: maximumSize=50,expireAfterAccess=60s
profile-level-type: maximumSize=5,expireAfterAccess=3600s
Is it possible? If not with Caffeine at least with another cache provider (JCache, EhCache, etc.)?