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

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

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

Properties

Cache storage manager. Default is memory.

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.

optional
maxSize: number

Maximum size of the cache.

optional
isCacheableValue: (value: any) => boolean

A function to determine if a value is cacheable. Defaults to only cache

optional
getCacheKey: (params: { constructorName: string; methodName: string; methodType: string; args: any[]; }) => string

A function to determine the cache key. Defaults to the request url.

optional
policy: CachePolicy

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

optional
isDebug: boolean
optional
kvStoreBaseKey: string

The key of the kv store base key.