What problem does it solve?
This Skill enforces a consistent 4-layer caching strategy, eliminating redundant data fetches and ensuring optimal application performance across React, Next.js, Redis, and Cloudinary, while simplifying cache invalidation.
Core Features & Use Cases
- Multi-Layered Caching: Guides the use of React
cache(), Next.js unstable_cache(), Upstash Redis, and Cloudinary for appropriate caching scenarios.
- Standardized Cache Keys & Tags: Enforces the use of
CACHE_KEYS, REDIS_KEYS, and CacheTagGenerators for consistent and effective cache management.
- Coordinated Cache Invalidation: Ensures mutations trigger precise cache invalidation using
CacheRevalidationService to maintain data freshness.
- Use Case: When implementing a public search endpoint, this Skill guides the use of
CacheService.redisSearch.publicDropdown() for high-traffic queries, ensuring appropriate REDIS_TTL and createHashFromObject() for key generation, and CacheService.search.invalidatePublic() for invalidation.
Quick Start
Implement caching for a public API endpoint that fetches a list of 'Featured Products', using CacheService.featured.content() and ensuring proper cache invalidation upon product updates.