implement-cache-strategy

Implement a unified reactive caching layer with pluggable backends for Firefly Framework services.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/fireflyframework/fireflyframework-claude-skills --skill implement-cache-strategy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implement-cache-strategy
Source: https://github.com/fireflyframework/fireflyframework-claude-skills/tree/main/skills/implement-cache-strategy
Command: npx skills add https://github.com/fireflyframework/fireflyframework-claude-skills --skill implement-cache-strategy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provide a unified reactive caching layer for Firefly Framework services by consolidating multiple backends (Caffeine, Redis, Hazelcast, JCACHE) behind a single CacheAdapter, enabling consistent usage, pluggable persistence, and predictable performance.

Core Features & Use Cases

  • Unified CacheAdapter with pluggable backends (Caffeine, Redis, Hazelcast, JCACHE) and L1/L2 composition.
  • SmartCacheAdapter support for multi-tier caching, health checks, and metrics; per-use-case CacheManagerFactory instances.
  • CQRS integration via QueryCacheAdapter and event-driven invalidation to keep reads fresh after writes.

Quick Start

Install and configure a cache using CacheManagerFactory, then wire your service to read/write through the cache with get/put semantics.

Frequently Asked Questions about implement-cache-strategy

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

FAQPage Schema
How do I implement a multi-tier cache with Redis and Caffeine in a reactive backend?

You can implement multi-tier caching by using a unified reactive CacheAdapter that composes Caffeine and Redis as L1 and L2 backends. This provides consistent cache usage, pluggable persistence, and predictable performance for fast cached reads.

How does event-driven cache invalidation work for CQRS architectures?

Event-driven cache invalidation in a CQRS setup uses a QueryCacheAdapter to keep reads fresh after writes. It triggers automatic cache invalidation when write events occur, ensuring cached query results remain consistent with the updated data store.

Can I use Hazelcast or JCACHE as a pluggable backend for Firefly Framework caching?

Yes, the unified caching layer supports Hazelcast and JCACHE as pluggable backends alongside Caffeine and Redis. Provider auto-selection allows you to switch cache persistence mechanisms while maintaining consistent get and put semantics.

What is the best way to monitor cache health and metrics for per-use-case caching?

The best way to monitor cache health is by using SmartCacheAdapter, which supports built-in health checks and metrics. You can create per-use-case CacheManagerFactory instances to track performance and isolate caching behavior for different services.

When should I use a write-through cache strategy instead of simple read caching?

You should use a write-through cache strategy when your services require fast cached reads alongside workflows that write data back to the primary data store. This ensures data consistency by synchronizing cache updates with database writes.

Does implement-cache-strategy support dependency management for backend providers?

Yes, the unified caching layer satisfies dependency management for backend providers. It handles provider auto-selection and configuration, allowing you to integrate multiple cache backends without manually resolving their dependencies.