/** * Memory-based Data Cache Handler for "use cache" directive * Based on Next.js default handler but with customizable options * * In-memory caches are fragile and should not use stale-while-revalidate * semantics because entries may be evicted before reuse. Stale entries * are considered expired/missing. */ import type { DataCacheHandler } from "./types.js"; export interface MemoryDataCacheHandlerOptions { /** * Maximum cache size in bytes * @default 50MB (50 * 1024 * 1024) */ maxSize?: number; /** * Enable debug logging * @default false */ debug?: boolean; } /** * Create a memory-based data cache handler for "use cache" directive * * @example * ```typescript * // cache-handler.mjs * import { createMemoryDataCacheHandler } from '@mrjasonroy/better-nextjs-cache-handler/data-cache'; * * export default createMemoryDataCacheHandler({ * maxSize: 100 * 1024 * 1024, // 100MB * debug: process.env.NODE_ENV === 'development' * }); * ``` * * Then in next.config.js: * ```javascript * module.exports = { * cacheComponents: true, * cacheHandlers: { * default: require.resolve('./cache-handler.mjs') * } * } * ``` */ export declare function createMemoryDataCacheHandler(options?: MemoryDataCacheHandlerOptions): DataCacheHandler; //# sourceMappingURL=memory.d.ts.map