Skip to content

createBuildCache

createBuildCache(): BuildCache

Defined in: packages/core/src/kernel/layer.ts:199

Create an in-memory BuildCache.

BuildCache

A fresh, empty BuildCache.

Backed by a plain Map. State lives for the lifetime of the returned object — there is no persistence. Pass a single instance across successive builder operations to benefit from .run() skipping.

import { createBuildCache, computeBuildCacheKey } from '@fishnet/core'
const cache = createBuildCache()
const key = await computeBuildCacheKey(undefined, 'echo hello')
cache.set(key, 'layer-abc')
cache.has(key) // true