alepha@docs:~/framework/docs/packages/alepha/cache$
cat core.md | pretty
1 min read
Last commit:

#Alepha - Cache

#Installation

Part of the alepha package. Import from alepha/cache.

npm install alepha

#Overview

Type-safe caching with TTL support.

Features:

  • Cached computations with type-safe keys and values
  • Configurable TTL
  • Cache invalidation
  • Automatic cache population
  • Providers: Redis when REDIS_URL is set, Memory otherwise (Node, Bun), Cloudflare (workerd), Database (per $cache)

Set REDIS_URL and every instance shares one cache; leave it unset and the cache is this process's memory. An app's own CacheProvider substitution wins over both.

#API Reference

#Primitives

  • $cache - Creates a cache primitive for caching with automatic management.

#Providers