UNPKG

@nimpl/cache-adapter

Version:

An adapter that allows you to use any cache handler on the client and server side and switch between them. Adds support for running next.js applications in multiple instances.

28 lines (27 loc) 754 B
import { type AdapterConfiguration } from "./types"; export declare class AppAdapter { private buildId; private cacheMode; private cacheUrl; private cacheHandler; private remoteCacheHandler; constructor({ CacheHandler, buildId, cacheUrl, cacheMode, options, buildReady, }: AdapterConfiguration); /** * get cache * @param key cache key * @returns cached data */ get(key: string): Promise<any>; /** * set cache * @param key cache key * @param data data to store * @param ctx next.js context */ set(key: string, data: any, ctx: any): Promise<any>; /** * revalidate tag in cache * @param tag cache tag */ revalidateTag(tag: string): Promise<void>; }