This document discusses caching in Spring and JSR-107. It provides an overview of the main caching annotations and entities in Spring and their equivalents in JSR-107. It also lists several popular caching providers and their support for local/distributed caching, non-blocking access, and integration with Spring and JSR-107. Finally, it provides some references for further information on Java caching.
3. Spring Cache
@EnableCaching enable caching
@Cacheable cache first, invoke method if not found
@CachePut invoke method, put into cache
@CacheEvict drop from cache, invoke method
@Caching combine different annotations
@CacheConfig cache configuration
4. Spring 4.1+ vs JSR-107
@Cacheable @CacheResult
@CachePut @CachePut (@CacheValue)
@CacheEvict @CacheRemove
@CacheEvict(allEntries = true) @CacheRemoveAll
@CacheConfig @CacheDefaults
@EnableCaching + JSR-107 API
+ spring-context-support
5. Cache providers features
Local/Distrib. Non-blocking JCache Spring
● Cache2k L - + +
● Caffeine L + + +
● Coherence Community Edition + + + -
● EhCache L - + +
● Geode + - - +
● Guava L - - -
● Hazelcast + + + +
● Ignite + + + +
● Infinispan + + + +
● JCS + - + -
● Redisson (non-Pro) D + + +
7. References
DZone Java Caching – https://dzone.com/refcardz/java-caching
A Java Geek Choosing a cache, A list of cache providers –
https://blog.frankel.ch/tag/cache/
Baeldung A Guide To Caching in Spring –
https://www.baeldung.com/spring-cache-tutorial
java T point Spring Boot Caching –
https://www.javatpoint.com/spring-boot-caching
Java Design Patterns – Caching –
https://java-design-patterns.com/patterns/caching/
etc.