I have implemented a caffeine cache in spring boot. This cache holds up to 30k elements. This affects the performance. Hence I want to implement compression on the values it stores. Please advise.
here is my config class:
@Configuration
@EnableCaching
public class CachingConfig {
@Bean
public CacheManager cacheManager() {
CaffeineCacheManager cacheManager = new CaffeineCacheManager();
cacheManager.setCaffeine(Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.MINUTES) // Set the expiration time
.maximumSize(30000).recordStats());
cacheManager.setCacheNames(Collections.singletonList("my_cache"));
return cacheManager;
}
}