redis-cache-patterns

Configure TTL-based caching and key naming for Spring Boot with Redis.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/sukeun1997/claude-config --skill redis-cache-patterns-sukeun1997
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: redis-cache-patterns
Source: https://github.com/sukeun1997/claude-config/tree/main/skills/redis-cache-patterns
Command: npx skills add https://github.com/sukeun1997/claude-config --skill redis-cache-patterns-sukeun1997

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Redis cache patterns address the challenges of designing robust, scalable caching for Spring Boot applications. They cover TTL policies, deterministic key naming, and reliable invalidation to keep data fresh while reducing database load.

Core Features & Use Cases

  • TTL-based caching configurations per cache region to balance freshness and performance.
  • Standardized key naming (for example haru:{domain}:{userId}:{identifier}) to ensure predictable cache lookups and evictions.
  • Comprehensive guidance for integrating with Spring Boot: configuration, @Cacheable usage, and eviction strategies.
  • Operational notes for monitoring, tuning TTLs, and avoiding common pitfalls.

Quick Start

Configure Spring Cache with Redis and apply the provided TTL, key-naming, and invalidation patterns to your services.

Frequently Asked Questions about redis-cache-patterns

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

FAQPage Schema
How do I configure Redis cache TTL policies per cache region in Spring Boot?

Redis cache TTL policies in Spring Boot are configured per cache region to balance data freshness and performance. This approach applies time-to-live settings to individual cache areas, ensuring predictable data expiration while reducing database load.

What's the best way to name Redis keys for predictable cache lookups and evictions in Spring Boot?

Standardized Redis key naming in Spring Boot uses a deterministic format like haru:{domain}:{userId}:{identifier} to ensure predictable cache lookups and evictions. This convention guarantees consistent cache access patterns across services for reliable invalidation.

How do I implement selective cache invalidation across multiple Spring Boot services using Spring Cache?

Selective cache invalidation across Spring Boot services uses Spring Cache eviction strategies combined with standardized key naming. This enables targeted cache clearing by domain and identifier, ensuring data freshness without impacting unrelated cache regions.

Why does my Spring Boot Redis cache return stale data after database updates?

Redis cache returning stale data in Spring Boot typically results from missing or misconfigured cache invalidation strategies. Implementing proper eviction patterns and standardized key naming ensures cache entries are cleared when underlying data changes.

Do I need Spring Cache and Redis configured before implementing cache patterns for Spring Boot applications?

Yes, Spring Cache and Redis must be properly configured before implementing cache patterns. These provide the foundational infrastructure required to apply TTL-based caching, key naming conventions, and selective invalidation strategies in Spring Boot applications.

What are common pitfalls when monitoring and tuning Redis cache TTLs in Spring Boot applications?

Common Redis cache TTL pitfalls in Spring Boot include improper freshness-to-performance balancing and lack of standardized key naming. Operational monitoring helps tune TTL configurations per cache region while avoiding stale data and unnecessary database load.