ix-cache

Provide in-memory key-value caching with TTL, LRU, and RESP protocol support.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/GuitarAlchemist/ix --skill ix-cache
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ix-cache
Source: https://github.com/GuitarAlchemist/ix/tree/main/.claude/skills/ix-cache
Command: npx skills add https://github.com/GuitarAlchemist/ix --skill ix-cache

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

ix-cache solves the problem of needing an efficient in-memory key-value store for applications that require caching, TTL-based expiry, LRU eviction, pub/sub messaging, or a lightweight Redis-compatible RESP server.

Core Features & Use Cases

  • Key-Value Store: Offers concurrent sharded HashMap with set, get, delete, keys operations.
  • TTL Management: Time-to-live expiry for keys to maintain cache freshness.
  • LRU Eviction: Implements LRU eviction when the cache reaches its capacity.
  • Pub/Sub Messaging: Provides in-process publish/subscribe channels for real-time updates.
  • RESP Server: Offers a Redis-compatible protocol server for integrating with other Redis clients.
  • Persistence: Allows snapshotting to disk for data preservation and can restore from these snapshots on startup.

Quick Start

To get started, create an instance of the Cache and set a key with a TTL, then retrieve it:

use ix_cache::{Cache, CacheConfig};

let cache = Cache::new(CacheConfig::default());
cache.set("key", &json!("value"), Some(std::time::Duration::from_secs(10)));
if let Some(value) = cache.get("key") {
  println!("Value retrieved: {:?}", value);
}

Frequently Asked Questions about ix-cache

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

FAQPage Schema
How do I implement in-memory key-value caching with TTL in my application?

In-memory key-value caching with TTL is implemented using a concurrent sharded HashMap supporting set, get, delete, and keys operations, alongside automatic time-to-live expiry to maintain cache freshness without external infrastructure.

What is the best way to cache data in-process without setting up external Redis infrastructure?

An in-process caching solution provides a Redis-compatible API and RESP protocol server, enabling fast, efficient data handling and reduced load times while requiring no external caching infrastructure to operate.

How does LRU eviction work when an in-memory cache reaches its capacity?

LRU eviction automatically removes the least recently used keys when the in-memory cache reaches its maximum capacity, ensuring memory constraints are respected while maintaining optimal application performance.

Can I use a Redis-compatible API for pub/sub messaging within a single process?

Yes, in-process publish/subscribe channels provide real-time pub/sub messaging capabilities, allowing components within the application to communicate efficiently without relying on an external message broker.

Does in-memory key-value store support snapshotting to disk for data persistence?

The in-memory store supports snapshotting to disk for data preservation and can automatically restore from these snapshots on startup, ensuring cached data survives application restarts.

What are the limitations of using an in-process cache versus a standalone Redis server?

An in-process cache is limited to the application's memory space and cannot be shared across multiple separate application instances, making it suitable for single-process performance enhancement rather than distributed caching.