epic-caching

Implement layered caching with cachified, SQLite, and in-memory LRU caches.

Updated Jan 31, 2026
One-click install
npx skills add https://github.com/M-Kolacz/michalkolacz.com --skill epic-caching-m-kolacz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: epic-caching
Source: https://github.com/M-Kolacz/michalkolacz.com/tree/main/docs/skills/epic-caching
Command: npx skills add https://github.com/M-Kolacz/michalkolacz.com --skill epic-caching-m-kolacz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps teams optimize performance by providing clear caching strategies using cachified with SQLite and in-memory LRU caches, reducing latency and database load.

Core Features & Use Cases

  • Two-tier caching model: SQLite cache with LiteFS replication and an in-memory LRU cache.
  • Guidance on when to use cache: Patterns, SWR, cache invalidation after mutations, and server timing integration.
  • Examples: Caching external API calls and expensive database queries.

Quick Start

Install and configure cachified in your Epic Stack app, set up a SQLite cache (with LiteFS if needed) or an in-memory cache, and wire the cache helpers into your data fetchers. Start using the cache to wrap external API calls and database queries; observe improved latency and reduced load.

Frequently Asked Questions about epic-caching

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

FAQPage Schema
How do I set up two-tier caching with SQLite and in-memory LRU caches?

Layered caching with cachified uses a SQLite cache with LiteFS replication alongside an in-memory LRU cache to reduce latency and database load. You wire cache helpers into data fetchers to wrap external API calls and expensive database queries.

When should I use stale-while-revalidate for caching database queries?

Stale-while-revalidate is useful for caching expensive database queries when you want to serve stale data immediately while fetching fresh data in the background. This pattern reduces latency and database load during high-traffic periods.

Does cachified support cache invalidation after database mutations?

Cachified supports cache invalidation after mutations. The Skill provides patterns for invalidating cached data following database updates or deletions to maintain data consistency.

Can I use LiteFS for multi-region SQLite cache replication?

Yes, LiteFS enables multi-region SQLite cache replication. The Skill covers multi-region cache considerations, allowing you to distribute your SQLite cache across regions while maintaining consistency and reducing latency for global users.

How do I validate cached API responses with Zod?

You validate cached API responses with Zod by defining schemas that cachified uses to validate data structure on retrieval. This ensures cached data matches expected formats, preventing runtime errors from stale or corrupted cache entries.

What is the best way to monitor cache performance with server timing?

Monitoring cache performance with server timing involves integrating cachified with server-timing headers to measure cache hit and miss durations. This helps identify slow fetches and verify that caching reduces overall response latency.