@hapi/catbox-memory v6.0.2
console
npm install @hapi/catbox-memory@6.0.2console
yarn add @hapi/catbox-memory@6.0.2console
pnpm add @hapi/catbox-memory@6.0.2Memory adaptor for catbox.
Compatibility
| Major version | License | Node.js |
|---|---|---|
| 6 | BSD | >= 16 |
Introduction
Memory adapter for catbox. This adapter is not designed to share a common cache between multiple processes (e.g. in a cluster mode). It uses a single interval timeout to look for expired records and clean them from memory.
new CatboxMemory.Engine(options)
maxByteSize- sets an upper limit on the number of bytes that can be stored in the cache. Once this limit is reached no additional items will be added to the cache until some expire. The utilized memory calculation is a rough approximation and must not be relied on. Defaults to104857600(100MB).minCleanupIntervalMsec- the minimum number of milliseconds in between each cache cleanup. Defaults to 1 second (1000).cloneBuffersOnGet- by default, buffers stored in the cache are copied when they are set but not when they are retrieved. This means a change to the buffer returned by aget()will change the value in the cache. To prevent this, setcloneBuffersOnGettotrueto always return a copy of the cached buffer. Defaults tofalse.