spring-cache

Configure RedisCacheManager with per-cache TTLs for Kotlin Spring projects.

1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/kssumin/claude-playground --skill spring-cache-kssumin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spring-cache
Source: https://github.com/kssumin/claude-playground/tree/main/.claude/skills/spring-cache
Command: npx skills add https://github.com/kssumin/claude-playground --skill spring-cache-kssumin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Kotlin applications using Spring Cache and Redis often struggle with consistent caching strategies, TTL management, and cross-module cache invalidation. This Skill provides practical patterns, configuration snippets, and usage guidance to implement reliable caching, reduce database reads, and improve performance across modules.

Core Features & Use Cases

  • Redis-backed cache management with RedisCacheManager and per-cache configurations
  • Common patterns: @Cacheable, @CacheEvict, @CachePut, and cache-aside control
  • TTL configuration, cache-region scoping, and multi-module integration best practices

Quick Start

Configure RedisCacheManager with per-cache TTLs in a Kotlin Spring project and start caching a representative domain dataset.

Frequently Asked Questions about spring-cache

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure RedisCacheManager with per-cache TTLs in a Kotlin Spring project?

Configure RedisCacheManager in a Kotlin Spring project by defining per-cache TTLs within a RedisCacheManager bean. This setup enables granular cache-region scoping and expiration control, allowing distinct Redis-backed caches to manage their own TTL values independently.

What is the best way to handle cache invalidation across multiple Spring modules using Redis?

Handle cross-module cache invalidation by applying @CacheEvict patterns within your service layer. This approach ensures that when underlying data changes, corresponding Redis cache entries are cleared consistently across multi-module architectures.

When do I need @Cacheable versus @CachePut for Redis caching in Spring?

Use @Cacheable to check and populate the Redis cache before method execution, skipping the method if cached data exists. Use @CachePut to force method execution and update the cache with new data without bypassing the underlying database read operation.

Does Spring Cache work with Kotlin to reduce database reads using Redis?

Yes, Spring Cache integrates with Kotlin to intercept service layer methods and store results in Redis. This caching strategy significantly reduces database reads by serving repeated requests directly from the Redis cache.

Why does my Spring Cache configuration fail to apply distinct TTLs to different cache regions?

Spring Cache configurations fail to apply distinct TTLs when cache-specific settings are not explicitly mapped in the RedisCacheManager setup. You must define individual TTL configurations per cache name to achieve proper cache-region scoping.