import type { RenderableTreeNode } from '@markdoc/markdoc' import KeyV from 'keyv' import { createHash } from 'node:crypto' const markdocVersion = '1' export const markdocCache = new KeyV({ namespace: `markdoc-cache-${markdocVersion}`, ttl: 1000 * 60 * 60 * 24 * 7, }) export const generateCacheKey = (content: string) => { return createHash('sha256') .update(content) .update(markdocVersion) .digest('hex') }