Classes

c
CacheService(
backend: CacheStore,
prefix: string,
defaultTtl?: number
)

Service layer that delegates to a backend CacheStore while applying:

c
MemoryStore(
_prefix: string,
options?: { maxSize?: number | undefined; clock?: ClockFn | undefined; }
)

In-memory cache implementation with LRU eviction and lazy TTL expiry.

c
NoopStore(_prefix?: string)

No-op implementation of CacheStore. Every method resolves without side effects: reads return null/false, writes resolve void, and lifecycle methods are no-ops.

c
RedisStore(
prefix: string,
options?: { url?: string | undefined; client?: IRedisClient | undefined; }
)

Redis-backed cache store implementation.

Functions

Interfaces

I
CachedResponsePayload

Serializable cached response payload stored in the cache backend. Body is base64-encoded when binary so that JSON-safe stores (Redis) can persist it without corruption.

I
CacheMiddlewareOptions

Options for the transparent response-caching middleware.

I
CachePluginOptions

Options for the CachePlugin factory.

I
CacheStoreOptions

Options for creating a cache store backend.

I
ICacheStore

Key/value cache with per-entry TTL.

I
IRedisClient

Structural shape of an ioredis-compatible client. Used for validation and injection so that the plugin does not hard-depend on ioredis.

Type Aliases

T
CacheStoreType = "memory" | "redis" | "noop"

Supported cache store backends.

Usage

import * as Caching_plugin_with_Memory_and_Redis_stores_and_cache_middleware___Exports_the_plugin_factory__service__store_implementations__middleware__and_all_public_option_types_ from "cache-plugin/src/index.ts";