Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/oak_nest/modules/cache/mod.ts>CacheManagerOptions

Refer to nestjs to realize some common functions for Deno, support hono and oak
Latest
interface CacheManagerOptions
import { type CacheManagerOptions } from "https://deno.land/x/oak_nest@v3.0.1/modules/cache/mod.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