Introduction
A dependency-free, lightweight runtime caching library for JavaScript and TypeScript applications.
RunCache allows you to cache string values with configurable time-to-live (TTL) settings and supports automatic value regeneration through source functions. It's designed to be easy to use while providing powerful features for advanced caching scenarios.
Key Features
Zero Dependencies: Lightweight implementation with no external dependencies
In-Memory Performance: Fast, efficient runtime cache for optimal application performance
Source Function Support: Cache values generated from synchronous or asynchronous functions
Automatic Refetching: Configure cache entries to automatically refresh on expiration
Comprehensive Event System: Subscribe to cache events including expiry, refetch, and refetch failures
Pattern Matching: Use wildcard patterns to operate on groups of related cache keys
Eviction Policies: Configure size limits with LRU (Least Recently Used) or LFU (Least Frequently Used) eviction strategies
Middleware Support: Add custom processing for intercepting and transforming cache operations
Tag-based Invalidation: Group related cache entries with tags for efficient batch invalidation
Dependency Tracking: Establish relationships between cache entries with automatic cascading invalidation
Persistent Storage: Store cache data across application restarts using various storage adapters
TypeScript Support: Full type definitions included
Quick Example
When to Use RunCache
RunCache is ideal for:
Caching API responses to reduce network requests
Storing computed values to improve application performance
Managing temporary data with automatic expiration
Creating relationships between cached data with dependencies
Implementing complex caching strategies with middleware
Getting Started
To get started with RunCache, check out the Installation guide.
Last updated