@fortedigital/nextjs-cache-handler
Version:
Next.js cache handlers
20 lines (17 loc) • 731 B
text/typescript
import { Handler, CacheHandlerValue } from './cache-handler.types.cjs';
import 'next/dist/server/lib/incremental-cache';
import 'next/dist/server/lib/incremental-cache/file-system-cache';
type CreateCompositeHandlerOptions = {
/**
* A collection of handlers to manage the cache.
*/
handlers: Handler[];
/**
* Strategy to determine which handler to use for the set operation.
* Defaults to the first handler if not provided.
* @param data - The data to be saved in one of the handlers. See {@link CacheHandlerValue}.
* @returns The index of the handler for the set operation.
*/
setStrategy: (data: CacheHandlerValue) => number;
};
export type { CreateCompositeHandlerOptions };