Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
class PersistentCache
extends Cache<VALUE>
import { PersistentCache } from "https://deno.land/x/frugal@0.5.0/docs/dep/frugal/core.ts";

A Cache that can be persisted using a Persistence layer (filesystem, Redis, etc...)

Constructors

new
PersistentCache(
cachePath: string,
serializedCache: SerializedCache,
config: PersistentCacheConfig,
)

Type Parameters

optional
VALUE = unknown

Methods

save(): Promise<void>

Save the hot data to the persistence layer

Static Methods

load(cachePath: string, config: PersistentCacheConfig)

Load the cache from persistence. All persisted data is cold data, and hot data is empty at first.