Spring Boot 2 Cache

Ehcache 3.x

  1. Maven dependencies
    • Older spring boot versions support ehcache 2.x available under net.sf.ehcache package.
    • New versions of Spring boot support ehcache 3.x available under org.ehcache package.
  2. application.properties
    • spring.cache.jcache.config=classpath:ehcache.xml
  3. ehcache.xml
  4. CacheEventListener: CustomCacheEventListener
  5. @EnableCaching: CacheConfig
  6. @Cacheable Annotation: EmployeeManager
  7. Spring CacheManager API
  8. Spring boot ehcache 3 example – demo
    • Employee
    • EhcacheController