@varasto/cache-storage
Version:
Varasto storage implementation that acts as cache for another storage
10 lines (9 loc) • 375 B
TypeScript
import { Storage } from '@varasto/storage';
/**
* Constructs storage that acts as an cache for another storage.
*
* @param storage Storage to create cache for.
* @param ttl Lifespan in milliseconds for cached entries. If omitted, entries
* will be cached indefinitely.
*/
export declare const createCacheStorage: (storage: Storage, ttl?: number) => Storage;