Ox Content

cache.ts

Source

computeCacheKey

function

Computes a cache key from template + props + options.

Source


getCached

function

Checks if a cached PNG exists for the given key. Returns the cached file path if found, null otherwise.

Source

export async function getCached(cacheDir: string, key: string): Promise<Buffer | null>

Returns

Promise<Buffer | null> -


writeCache

function

Writes a PNG buffer to the cache.

Source

export async function writeCache(cacheDir: string, key: string, png: Buffer): Promise<void>

Returns

Promise<void> -