
Spring Boot Cache
Step-by-step Spring Boot caching guide that configures providers, annotations, TTL, and Actuator metrics.
- skills.sh installs
- 4K
- GitHub stars
- 372
- last updated
- Aug 21, 2026
What it does
- Covers the caching workflow: dependencies,
@EnableCaching,@Cacheable/@CachePut/@CacheEvictannotations, TTL configuration, and validation - Includes Caffeine, Redis, and Ehcache provider setup, plus SpEL key shaping with
conditionandunlessguards - Enforces a self-invocation check, since calls within the same class bypass the proxy and the cache
- Designed for Spring Boot 3.5+ services that need hit/miss diagnosis through
GET /actuator/cachesandcache.getsmetrics
Install
$ npx -y skills add giuseppe-trisciuoglio/developer-kit --skill spring-boot-cache -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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.
Details
- Repository
- github.com/giuseppe-trisciuoglio/developer-kit
- Categories
- Java & JVM, Backend & APIs
- First seen
- May 16, 2026
More from giuseppe-trisciuoglio/developer-kit
All 95- Spring Boot Resilience4j4K
- Nextjs Code Review4K
- Unit Test Service Layer4K
- Spring Ai Mcp Server Patterns4K
- Unit Test Wiremock Rest Api4K
- Nextjs Authentication4K
- Spring Boot Actuator4K
- Spring Boot Dependency Injection4K
- Unit Test Parameterized4K
- Unit Test Controller Layer4K
- Unit Test Json Serialization4K
- Spring Boot Saga Pattern3.9K
- Nextjs Data Fetching3.9K
- Spring Data Neo4j3.9K
- Unit Test Security Authorization3.9K
- Nx Monorepo3.9K
- Langchain4j Spring Boot Integration3.9K
- Langchain4j Tool Function Calling Patterns3.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
Similar to Spring Boot Cache
More Java & JVM
unit-test-cachinggiuseppe-trisciuoglio/developer-kit3.9K installsUnit tests for Spring cache annotations using an in-memory ConcurrentMapCacheManager and mocked repositories.
spring-boot-resilience4jgiuseppe-trisciuoglio/developer-kit4K installsFault-tolerance annotations for Spring Boot 3.x covering circuit breakers, retries, rate limiters, bulkheads, time limiters, and fallbacks.
spring-bootmindrally/skills877 installsExpert Spring Boot guidance covering REST APIs, testing, security, and deployment for Java 17+ projects.
java-spring-bootpluginagentmarketplace/custom-plugin-java11.8K installsProduction Spring Boot guidance covering REST APIs, Spring Security, Spring Data JPA, and Actuator monitoring.
kotlin-springbootgithub/awesome-copilot9.8K installsBest-practices guide for Spring Boot services written in Kotlin, covering setup, injection, data, and testing.