SkillAgentSearch skills...

spring-boot-cache

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

Install / Use

npx skills add giuseppe-trisciuoglio/developer-kit --skill spring-boot-cache

Installs into whichever agent you are using.

About this skill
πŸ“„

SKILL.md

Installable skill definition

Quality Score

86/100

Category

Automation

Supported Platforms

Universal

Our assessment of spring-boot-cache

spring-boot-cache scores 86/100 on our quality scale, 1704th of 2,758 Automation skills we index.

Its SKILL.md is 5.4 KB long, well organised into 14 sections with 4 code examples: a solid amount of guidance for an agent.

It has 372 GitHub stars, a meaningful sign that others use it.

Substance
26/30
Structure
20/20
Description
15/15
Adoption
11/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so spring-boot-cache is actively maintained.
  • Our last check on 2026-11-02 found the source still online.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit β€” read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-10-07. Automated pattern scan on 2026-10-07. It catches known dangerous patterns, not every risk β€” read a skill before letting an agent act on it.

spring-boot-cache compared with similar skills

All 4 of these similar skills score higher than spring-boot-cache; compare them before choosing.

SkillScoreStarsUpdatedFormat
spring-boot-cache (this skill)by giuseppe-trisciuoglio863722mo agoSKILL.md
Agent-Reachby Panniantong100114.0ktodayCLAUDE.md
rufloby ruvnet10082.3ktodayCLAUDE.md
Claude-Code-Game-Studiosby Donchitos10040.6k12d agoCLAUDE.md
Scraplingby D4Vinci100104.9k5d agoMCP Server

Frequently asked questions

How do I install spring-boot-cache?
Run npx skills add giuseppe-trisciuoglio/developer-kit --skill spring-boot-cache. The install tabs above show the steps for each supported agent.
Which AI agents does spring-boot-cache work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is spring-boot-cache safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is spring-boot-cache still maintained?
The repository was last updated about 2 months ago, so spring-boot-cache is actively maintained.

name: spring-boot-cache description: "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." allowed-tools: Read, Write, Bash

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 @CacheEvict to 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

  1. Add dependencies β€” spring-boot-starter-cache plus a provider:

    • Caffeine: caffeine starter
    • Redis: spring-boot-starter-data-redis
    • Ehcache: ehcache starter
  2. Enable caching β€” annotate a @Configuration class with @EnableCaching and define a CacheManager bean.

  3. Annotate methods β€” @Cacheable for reads, @CachePut for writes, @CacheEvict for deletions.

  4. Configure TTL/eviction β€” set spring.cache.caffeine.spec, spring.cache.redis.time-to-live, or spring.cache.ehcache.config.

  5. Shape keys β€” use SpEL in key attributes; guard with condition/unless for selective caching.

  6. Validate setup β€” run integration test to confirm cache hit on second call; check GET /actuator/caches to verify cache manager registration; query GET /actuator/metrics/cache.gets for hit/miss ratios.

Examples

Example 1: Basic @Cacheable Usage

@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 skipped

Example 2: Conditional Caching with SpEL

@Cacheable(value = "products", key = "#id", condition = "#price > 100")
public Product getProduct(Long id, BigDecimal price) { ... }

// Only expensive products are cached

Example 3: Cache Eviction

@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.

Advanced Options

  • Use JCache annotations (@CacheResult, @CacheRemove) for providers favoring JSR-107 interoperability; avoid mixing with Spring annotations on the same method.
  • Cache reactive return types (Mono, Flux) or CompletableFuture values.
  • Apply HTTP CacheControl headers when exposing cached responses via REST.
  • Schedule periodic eviction with @Scheduled for time-bound caches.
  • Create a CacheManagementService for programmatic cacheManager.getCache(name).

Troubleshooting

If cache misses persist after adding @Cacheable:

  1. Verify @EnableCaching is present on a @Configuration class.
  2. Confirm the method is public and called from outside the class (Spring uses proxies; self-invocation bypasses the cache).
  3. Validate SpEL key expressions resolve correctly.
  4. Confirm the cache manager bean is registered as cacheManager or explicitly referenced via cacheManager = "myCacheManager".

References

Best Practices

  • Prefer constructor injection and immutable DTOs for cache entries.
  • Separate cache names per aggregate (users, orders) to simplify eviction.
  • Log cache hits/misses only at debug; push metrics via Micrometer.
  • Tune TTLs based on data staleness tolerance; document rationale in code.
  • Guard caches storing PII or credentials with encryption or avoid caching.
  • Align cache eviction with transactional boundaries to prevent dirty reads.

Constraints and Warnings

  • Avoid caching mutable entities that depend on open persistence contexts.
  • Do not mix Spring cache annotations with JCache annotations on the same method.
  • Validate serialization compatibility when caching across service instances.
  • Monitor memory footprint to prevent OOM with in-memory stores.
  • Caffeine + Redis multi-level caches require publish/subscribe invalidation channels.

Related Skills

Related Skills

View on GitHub
GitHub Stars372
CategoryAutomation
Updated2mo ago
Forks42

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit β€” see the Safety scan above for what the skill file itself contains.

No cautions
spring-boot-cache β€” Universal Skill: Install & Safety Check | SkillAgent