stacks-cache

Manage application-level caching with memory or Redis drivers in Stacks.

2|Updated Jul 8, 2026
One-click install
npx skills add https://github.com/bughq/bughq --skill stacks-cache-bughq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stacks-cache
Source: https://github.com/bughq/bughq/tree/main/.claude/skills/stacks-cache
Command: npx skills add https://github.com/bughq/bughq --skill stacks-cache-bughq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the complexity of managing application state and performance by providing a unified interface for memory and Redis-based caching, preventing redundant computations and database load.

Core Features & Use Cases

  • Cache-Aside Pattern: Easily implement getOrSet logic to fetch data only on cache misses.
  • Flexible Drivers: Seamlessly switch between memory-based storage for speed and Redis for persistence.
  • Use Case: Use this to cache expensive database queries or API responses, significantly reducing latency for frequently accessed data in your Stacks application.

Quick Start

Use the stacks-cache skill to implement a cache-aside pattern for your expensive database query by wrapping the fetch logic in the cache getOrSet method.

Frequently Asked Questions about stacks-cache

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

FAQPage Schema
How do I cache expensive database queries in a Stacks application?

To cache expensive database queries in a Stacks application, use the cache-aside pattern by wrapping your fetch logic in the cache getOrSet method, which fetches data only on cache misses to reduce database load and latency.

Can I switch between memory and Redis for caching in Stacks?

Yes, you can seamlessly switch between memory and Redis for caching in Stacks. This flexible driver system lets you choose memory-based storage for speed or Redis for persistence using TypeScript-based configuration.

How does the cache-aside pattern work for API response caching?

The cache-aside pattern for API response caching works by using a getOrSet method that checks the cache first and fetches from the source only on a miss, preventing redundant computations and significantly reducing latency.

Does Stacks support TTL management for Redis caches?

Yes, Stacks supports TTL management for Redis caches. The framework facilitates performance optimization through TTL management, cache-aside patterns, and statistical monitoring for high-throughput data retrieval.

What is the best way to monitor cache statistics in a Stacks app?

The best way to monitor cache statistics in a Stacks app is using the built-in statistical monitoring features, which track cache interactions and help optimize high-throughput data retrieval performance.