UNPKG

@hokify/node-ts-cache-lru-redis-storage

Version:

Simple and extensible caching module supporting decorators

17 lines (16 loc) 587 B
import { IAsynchronousCacheType } from '@hokify/node-ts-cache'; import LRU from 'lru-cache'; import * as Redis from 'ioredis'; export declare class LRUWithRedisStorage implements IAsynchronousCacheType { private redis; private myCache; /** maxAge and ttl in seconds! */ private options; constructor(options: LRU.Options<string, any>, redis: () => Redis.Redis); getItem<T>(key: string): Promise<T | undefined>; /** ttl in seconds! */ setItem(key: string, content: any, options?: { ttl?: number; }): Promise<void>; clear(): Promise<void>; }