Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno_nest/modules/cache/src/cache.interface.ts>CacheManagerOptions

Refer to nestjs to realize some common functions for Deno, support hono and oak
Go to Latest
interface CacheManagerOptions
import { type CacheManagerOptions } from "https://deno.land/x/deno_nest@v3.6.2/modules/cache/src/cache.interface.ts";

Interface defining Cache Manager configuration options.

Properties

optional
store:
| "memory"
| "localStorage"

Cache storage manager. Default is 'memory' (in-memory store). See Different stores for more info.

optional
defaultStore: "memory" | "localStorage" | string
optional
ttl: number

Time to live - amount of time in seconds that a response is cached before it is deleted. Subsequent request will call through the route handler and refresh the cache. Defaults to 5 seconds.

optional
max: number

Maximum number of responses to store in the cache. Defaults to 100.

optional
maxSize: number
optional
isCacheableValue: (value: any) => boolean
optional
getCacheKey: (params: { constructorName: string; methodName: string; methodType: string; args: any[]; }) => string
optional
policy: CachePolicy

This options will be used to configure the cache-control header.

optional
isDebug: boolean