Redis as a Cache Provider
Configure Redis-backed caching.
Why Redis for Caching
Redis is an in-memory data store that works as a distributed cache shared across many app instances.
- Survives app restarts
- Shared by all nodes
- Supports TTL and eviction
Adding the Dependency
Add Spring Data Redis to switch the cache backend to Redis.
// build.gradle
implementation "org.springframework.boot:spring-boot-starter-data-redis"All lessons in this course
- The Spring Cache Abstraction
- @Cacheable, @CachePut, @CacheEvict
- Redis as a Cache Provider
- Cache TTL and Invalidation