Search code examples
cachingspring-bootguava

Why is GuavaCacheConfiguration deprecated in Spring Boot 1.5.3?


I was thinking about replacing custom Guava cache configuration with AutoConfiguration... but found that the latter one is deprecated already.

Tried searching in Spring Boot documentation and GitHub repo, but has not found a clear answer. It's just deprecated in stable version and removed in master.

I respect (and use) both Spring Boot & Guava, so I'd like to understand the reason of this change.


Solution

  • Search for "Guava" in Spring Boot features - Caching and it says that should use Caffeine instead:

    Caffeine is a Java 8 rewrite of Guava’s cache and will supersede the Guava support in Spring Boot 2.0.

    It's basically Guava cache on steroids (it has similar interface), so the switch should be straightforward.