JetCache is Alibaba’s Java caching layer over Redis, Caffeine, and in-memory stores. Annotations add TTL, two-level caches, refresh, and distributed locking for Spring applications.
Overview
JetCache gives Java projects a uniform Cache API across multiple caching backends. You can declare method caching with annotations, set TTL, enable two-level local-plus-remote caches, and refresh entries in distributed setups.
Implementations include linked remote stores, an in-memory Caffeine layer, and a simple local cache. The framework supports custom key generation, value serialization encoders, statistics collection, distributed refresh, asynchronous access with Lettuce, and cache invalidation across JVM processes.
Spring Boot integration lets you configure caches through application properties and a cache manager. Annotated methods can expire entries after a fixed number of seconds and use penetration protection in multi-threaded loads.
Recent releases target JDK 17+ and optional Spring Framework 6 or Spring Boot 3 for annotation support.
Key features
- Uniform Cache API across backends
- Annotated method caching with TTL
- Two-level local and remote caching
- Distributed refresh and distributed locks
- Spring Boot configuration support
- Statistics for method and instance caches
- Asynchronous cache access with Lettuce
- Cross-JVM local cache invalidation
Use cases
- Cache service method results in Spring apps
- Share Redis-backed caches across JVMs
- Reduce database load with timed eviction