Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides patterns for implementing Spring Boot caching: configures Redis/Caffeine/EhCache providers with TTL and eviction policies, applies @Cacheable/@CacheEvict/@CachePut annotations, validates cache hit/miss behavior, and exposes metrics via Actuator. Use when adding caching to Spring Boot services, configuring cache expiration, evicting stale data, or diagnosing cache misses.
.claude/skills/giuseppe-trisciuoglio-spring-boot-cache/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 172% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 135% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 79% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 133% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 232% | 0% |
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.
@Cacheable, @CachePut, or @CacheEvict to service methods.spring-boot-starter-cache plus a provider:caffeine starterspring-boot-starter-data-redisehcache starter@Configuration class with @EnableCachingand define a CacheManager bean.
@Cacheable for reads, @CachePut for writes,@CacheEvict for deletions.
spring.cache.caffeine.spec,spring.cache.redis.time-to-live, or spring.cache.ehcache.config.
key attributes; guard withcondition/unless for selective caching.
call; check GET /actuator/caches to verify cache manager registration; query GET /actuator/metrics/cache.gets for hit/miss ratios.
@Cacheable Usagejava@Service @CacheConfig(cacheNames = "users") class UserService { @Cacheable(key = "#id", unless = "#result == null") User findUser(Long id) { ... } }
First call → cache miss, repository invoked
Second call → cache hit, repository skippedjava@Cacheable(value = "products", key = "#id", condition = "#price > 100") public Product getProduct(Long id, BigDecimal price) { ... } // Only expensive products are cached
java@CacheEvict(value = "users", key = "#id") public void deleteUser(Long id) { ... }
For progressive scenarios (basic product cache, multilevel eviction, Redis integration), load references/cache-examples.md.
@CacheResult, @CacheRemove) for providers favoringJSR-107 interoperability; avoid mixing with Spring annotations on the same method.
Mono, Flux) or CompletableFuture values.CacheControl headers when exposing cached responses via REST.@Scheduled for time-bound caches.CacheManagementService for programmatic cacheManager.getCache(name).If cache misses persist after adding @Cacheable:
@EnableCaching is present on a @Configuration class.proxies; self-invocation bypasses the cache).
cacheManager or explicitlyreferenced via cacheManager = "myCacheManager".
references/spring-framework-cache-docs.md:curated excerpts from Spring Framework Reference Guide.
references/spring-cache-doc-snippet.md:narrative overview from Spring documentation.
references/cache-core-reference.md:annotation parameters, dependency matrices, property catalogs.
references/cache-examples.md:end-to-end examples with tests.
users, orders) to simplify eviction.../spring-boot-rest-api-standards../spring-boot-test-patterns../unit-test-caching| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 4,874 | 3,054 | -37% | 1 | 1 | 0% | 762 | 1,789 | +135% | 0 | 0 | — |
case-02 | pass→pass | 6,302 | 4,303 | -32% | 1 | 1 | 0% | 1,115 | 1,999 | +79% | 0 | 0 | — |
case-03 | pass→pass | 5,150 | 3,920 | -24% | 1 | 1 | 0% | 821 | 1,917 | +133% | 0 | 0 | — |
case-04 | fail→pass | 4,025 | 3,940 | -2% | 1 | 1 | 0% | 684 | 1,861 | +172% | 0 | 0 | — |
case-05 | pass→pass | 3,653 | 4,757 | +30% | 1 | 1 | 0% | 622 | 2,063 | +232% | 0 | 0 | — |
case-06 | pass→pass | 12,696 | 10,625 | -16% | 1 | 1 | 0% | 2,139 | 3,098 | +45% | 0 | 0 | — |
case-07 | pass→pass | 10,585 | 3,737 | -65% | 1 | 1 | 0% | 1,785 | 1,869 | +5% | 0 | 0 | — |
case-08 | pass→pass | 3,297 | 3,995 | +21% | 1 | 1 | 0% | 453 | 1,873 | +313% | 0 | 0 | — |
case-09 | pass→pass | 3,712 | 3,446 | -7% | 1 | 1 | 0% | 641 | 1,850 | +189% | 0 | 0 | — |
case-10 | pass→pass | 11,520 | 4,155 | -64% | 1 | 1 | 0% | 1,132 | 1,997 | +76% | 0 | 0 | — |
case-11 | pass→pass | 3,407 | 2,749 | -19% | 1 | 1 | 0% | 500 | 1,723 | +245% | 0 | 0 | — |
case-12 | pass→pass | 3,608 | 3,214 | -11% | 1 | 1 | 0% | 708 | 1,827 | +158% | 0 | 0 | — |
case-13 | pass→pass | 4,053 | 3,531 | -13% | 1 | 1 | 0% | 587 | 1,790 | +205% | 0 | 0 | — |
case-14 | pass→pass | 12,965 | 7,525 | -42% | 1 | 1 | 0% | 2,075 | 2,331 | +12% | 0 | 0 | — |
case-15 | pass→pass | 10,446 | 9,103 | -13% | 1 | 1 | 0% | 1,577 | 2,820 | +79% | 0 | 0 | — |
case-16 | pass→pass | 8,134 | 7,192 | -12% | 1 | 1 | 0% | 1,660 | 2,458 | +48% | 0 | 0 | — |
case-17 | pass→pass | 3,223 | 2,455 | -24% | 1 | 1 | 0% | 515 | 1,661 | +223% | 0 | 0 | — |
case-18 | pass→pass | 3,493 | 2,886 | -17% | 1 | 1 | 0% | 546 | 1,716 | +214% | 0 | 0 | — |
case-19 | pass→pass | 7,803 | 4,451 | -43% | 1 | 1 | 0% | 1,369 | 2,081 | +52% | 0 | 0 | — |
case-20 | pass→pass | 4,372 | 2,217 | -49% | 1 | 1 | 0% | 803 | 1,616 | +101% | 0 | 0 | — |
case-21 | pass→pass | 16,640 | 13,460 | -19% | 1 | 1 | 0% | 2,710 | 3,674 | +36% | 0 | 0 | — |
case-22 | pass→pass | 12,750 | 13,473 | +6% | 1 | 1 | 0% | 2,123 | 3,561 | +68% | 0 | 0 | — |
case-23 | pass→pass | 13,779 | 14,435 | +5% | 1 | 1 | 0% | 2,125 | 3,932 | +85% | 0 | 0 | — |
case-24 | pass→pass | 8,984 | 7,292 | -19% | 1 | 1 | 0% | 1,591 | 2,494 | +57% | 0 | 0 | — |
case-25 | pass→pass | 10,027 | 7,062 | -30% | 1 | 1 | 0% | 1,766 | 2,534 | +43% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted. The headline lift of +4 percentage points is the difference between those two pass rates over the 25 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.