tucache-caching

Implement annotation-based method result caching and invalidation for Spring Boot applications.

50|8|Updated Dec 6, 2020
One-click install
npx skills add https://github.com/tri5m/tutu-cache --skill tucache-caching
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tucache-caching
Source: https://github.com/tri5m/tutu-cache/tree/main
Command: npx skills add https://github.com/tri5m/tutu-cache --skill tucache-caching

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires spring-context, aspectjweaver, caffeine, spring-data-redis, redisson, and includes assets (resource) components.

What problem does it solve?

This Skill addresses the complexity of managing method-level caching in Spring Boot applications by providing a lightweight, annotation-based alternative to standard caching mechanisms.

Core Features & Use Cases

  • Annotation-Driven Caching: Easily cache method results with @TuCache and invalidate them with @TuCacheClear.
  • Flexible Invalidation: Supports both exact key deletion and wildcard-based prefix invalidation.
  • Use Case: Use this Skill to optimize read-heavy service methods by caching results with a stable business namespace, and automatically clear those caches when the underlying data is updated.

Quick Start

Use the tucache-caching skill to add a cache layer to your service method by applying the @TuCache annotation with a specific business key and timeout.

Frequently Asked Questions about tucache-caching

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement Spring Boot method caching with annotations?▼

Spring Boot method caching can be implemented using the @TuCache annotation to cache method results with a specific business key and timeout, optimizing read-heavy service methods.

How do I invalidate caches in Spring Boot when underlying data updates?▼

Cache invalidation in Spring Boot is handled by the @TuCacheClear annotation, which supports both exact key deletion and wildcard-based prefix invalidation to ensure data consistency.

Can I use Redis as a cache backend for Spring Boot annotation caching?▼

Redis is a supported cache backend for Spring Boot annotation caching, requiring the integration of the tucache-spring-boot-starter dependency alongside spring-data-redis or redisson for configuration.

What is the best way to clear cached method results using wildcard prefixes?▼

Clearing cached method results using wildcard prefixes is achieved through the @TuCacheClear annotation, which enables flexible wildcard-based prefix invalidation for maintaining data consistency.

Does Spring Boot caching support SpEL for dynamic cache keys?▼

Spring Boot caching with TuCache supports SpEL, allowing developers to define dynamic cache keys and precise invalidation rules within the @TuCache and @TuCacheClear annotations.

Do I need Caffeine to configure local memory caching in Spring Boot?▼

Caffeine is required as a dependency to configure local memory caching in Spring Boot, serving as a supported cache backend alternative to Redis for the tucache-spring-boot-starter.