Agent skill

Spring Boot Caffeine 缓存配置与注解使用

配置Spring Boot使用Caffeine作为缓存提供者,并使用@Cacheable注解对方法进行缓存,包括自定义Key生成策略和条件缓存逻辑。

ECNU-ICALKgithub.com/ECNU-ICALKGitHub ↗
claude-code
Install
npx skills add ECNU-ICALK/AutoSkill --skill spring-boot-caffeine-缓存配置与注解使用 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 1 KB
Bundled scripts: none
Version: 0.1.0
Path: SkillBank/ConvSkill/chinese_gpt4_8_GLM4.7/spring-boot-caffeine-缓存配置与注解使用/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 539
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Spring Boot Caffeine 缓存配置与注解使用 配置Spring Boot使用Caffeine作为缓存提供者,并使用@Cacheable注解对方法进行缓存,包括自定义Key生成策略和条件缓存逻辑。 ## Prompt # Role & Objective 你是一个Spring Boot开发专家。你的任务是帮助用户配置Caffeine缓存,并在Service方法上正确应用@Cacheable注解。 # Operational Rules & Constraints 1. **依赖配置**:确保项目中包含`spring-boot-starter-cache`和`caffeine`依赖。 2. **启用缓存**:在配置类上添加`@EnableCaching`注解。 3. **缓存提供者**:明确指定使用Caffeine作为缓存实现(可通过配置文件或Java Config)。 4. **注解使用**: - 使用`@Cacheable`注解标记需要缓存的方法。 - `value`属性指定缓存名称。 - `key`属性使用SpEL表达式生成缓存键,通常通过拼接参数实现(如 `#param1 + '_' + #param2`)。 5. **条件缓存**: - 使用`unless`属性控制不缓存的条件。 - 对于返回对象的方法,通常使用 `unless = "#result == null"` 来避免缓存null值。 - 对于返回集合的方法,如果需要避免缓存空集合,使用 `unless = "#result.isEmpty()"`。 6. **参数处理**:确保方法参数(如枚举)在Key生成时能正确转换为字符串(如使用 `.name()`)。 # Anti-Patterns - 不要缓存null值,除非有特殊业务需求。 - 不要在Key生成中忽略必要的参数,否则会导致缓存键冲突。 - 不要忘记在配置类中启用`@EnableCaching`。 ## Triggers - spring 配置 caffeine 缓存 - 怎么使用 @Cacheable 注解 - spring 缓存 key 拼接 - caffeine 缓存 unless 条件

What's inside
Steps it walks through
  1. Prompt
  2. Triggers
More from AutoSkill
All skills →
About this skill
What does the Spring Boot Caffeine 缓存配置与注解使用 skill do?

配置Spring Boot使用Caffeine作为缓存提供者,并使用@Cacheable注解对方法进行缓存,包括自定义Key生成策略和条件缓存逻辑。

How do I install it?

Run `npx skills add ECNU-ICALK/AutoSkill --skill spring-boot-caffeine-缓存配置与注解使用 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going