
Spring Boot Cache
Wraps Spring Boot's caching abstraction with support for Caffeine, Redis, and EhCache. You get a six-step workflow covering dependencies, @EnableCaching setup, method annotations (@Cacheable, @CachePut, @CacheEvict), TTL configuration, SpEL key expressions, and Actuator metrics validation. Includes guard clauses for conditional caching and examples of common eviction patterns. The troubleshooting section correctly calls out the proxy gotcha where self-invocation bypasses the cache, which trips up a lot of people. References include curated Spring docs excerpts and end-to-end test examples. Best used when you need to add caching to service methods and want concrete patterns instead of reading the full Spring documentation.
- skills.sh installs
- 4K
- GitHub stars
- 369
- last updated
- Aug 21, 2026
Install
$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill spring-boot-cache --agent claude-codeInstalls into .claude/skills of the current project.
Files
Spring Boot Cache Abstraction
Overview
6-step workflow for enabling cache abstraction, configuring providers (Caffeine,
Redis, Ehcache), annotating service methods, and validating behavior in
Spring Boot 3.5+ applications. Apply @Cacheable for reads, @CachePut for
writes, @CacheEvict for deletions. Configure TTL/eviction policies and expose
metrics via Actuator.
When to Use
- Add
@Cacheable,@CachePut, or@CacheEvictto service methods. - Configure Caffeine, Redis, or Ehcache with TTL and capacity policies.
- Implement eviction strategies for stale data.
- Diagnose cache misses or invalidation issues.
- Expose hit/miss metrics via Actuator or Micrometer.
Instructions
-
Add dependencies —
spring-boot-starter-cacheplus a provider:- Caffeine:
caffeinestarter - Redis:
spring-boot-starter-data-redis - Ehcache:
ehcachestarter
- Caffeine:
-
Enable caching — annotate a
@Configurationclass with@EnableCachingand define aCacheManagerbean. -
Annotate methods —
@Cacheablefor reads,@CachePutfor writes,@CacheEvictfor deletions.
Sponsors
Details
- Repository
- github.com/giuseppe-trisciuoglio/developer-kit
- Categories
- Backend & APIs, Java & JVM, Databases
- First seen
- May 16, 2026
More from giuseppe-trisciuoglio/developer-kit
All 102- Spring Boot Resilience4j3.9K
- Unit Test Service Layer3.9K
- Nextjs Code Review3.9K
- Spring Ai Mcp Server Patterns3.9K
- Unit Test Wiremock Rest Api3.9K
- Spring Boot Actuator3.9K
- Nextjs Authentication3.9K
- Spring Boot Dependency Injection3.9K
- Unit Test Controller Layer3.9K
- Unit Test Parameterized3.9K
- Unit Test Json Serialization3.9K
- Spring Boot Saga Pattern3.9K
- Spring Data Neo4j3.9K
- Unit Test Security Authorization3.9K
- Nextjs Data Fetching3.9K
- Langchain4j Tool Function Calling Patterns3.9K
- Nx Monorepo3.9K
- Langchain4j Spring Boot Integration3.9K
- Langchain4j Rag Implementation Patterns3.9K
- Unit Test Scheduled Async3.9K
- Rag3.9K
- Unit Test Utility Methods3.9K
- Qdrant3.9K
- Unit Test Exception Handler3.9K