Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Go to Latest
class PersistantCache
extends Cache<VALUE>
import { PersistantCache } from "https://deno.land/x/frugal@0.2.1/packages/core/mod.ts";

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

Constructors

new
PersistantCache(
cachePath: string,
serializedCache: SerializedCache,
config: PersistantCacheConfig,
)

Type Parameters

optional
VALUE = unknown

Methods

save(): Promise<void>

Save the hot data to the persistance layer

Static Methods

load(cachePath: string, config: PersistantCacheConfig)

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