CacheManagerOptions

Interface defining Cache Manager configuration options.


interface CacheManagerOptions {
  store?: string | CacheStoreFactory | CacheStore
  ttl?: number
  max?: number
  isCacheableValue?: (value: any) => boolean
}

Properties

Property Description
store?: string | CacheStoreFactory | CacheStore

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

ttl?: number

Time to live - amount of time 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. In cache-manager@^4 this value is in seconds. In cache-manager@^5 this value is in milliseconds.

max?: number

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

isCacheableValue?: (value: any) => boolean