Spring Cache abstraction for Spring Boot 3.x. Covers @Cacheable, @CacheEvict, @CachePut, cache managers (Caffeine, Redis, EhCache), TTL configuration, cache keys, conditional caching, and cache synchronization. USE WHEN: user mentions "spring cache", "@Cacheable", "@CacheEvict", "cache manager", "Caffeine cache", "@EnableCaching", "cache abstraction" DO NOT USE FOR: Redis operations - use `spring-data-redis` instead, distributed caching architecture - combine with `redis` skill
@SpringBootApplication
@EnableCaching
public class Application {}
@Service
public class UserService {
@Cacheable("users")
public User findById(Long id) {
return userRepository.findById(id).orElseThrow();
}
@CacheEvict(value = "users", key = "#id")
public void deleteUser(Long id) {
userRepository.deleteById(id);
}
}