Skip to content
On this page

Directus Cloud

Everything you need to start building. Provisioned in 90 seconds. Starting at $15/month.

Get Started

This is an auto-generated document to support extension builders understand the internal packages they can utilize. To find our written guides, tutorials, and API/SDK reference, check out our main docs .

Directus / @directus/memory / index / CacheMulti

Class: CacheMulti ​

Implements ​

Constructors ​

new CacheMulti() ​

new CacheMulti(config): CacheMulti

Parameters ​

• config: Omit<CacheConfigMulti, "type">

Returns ​

CacheMulti

Defined in ​

packages/memory/src/cache/lib/multi.ts:30

Properties ​

bus ​

bus: Bus

Defined in ​

packages/memory/src/cache/lib/multi.ts:28


local ​

local: CacheLocal

Defined in ​

packages/memory/src/cache/lib/multi.ts:26


processId ​

processId: string

Defined in ​

packages/memory/src/cache/lib/multi.ts:24


redis ​

redis: CacheRedis

Defined in ​

packages/memory/src/cache/lib/multi.ts:27

Methods ​

clear() ​

clear(): Promise<void>

Remove all keys from the cache

Returns ​

Promise<void>

Implementation of ​

Cache.clear

Defined in ​

packages/memory/src/cache/lib/multi.ts:72


delete() ​

delete(key): Promise<void>

Remove the given key from the cache

Parameters ​

• key: string

Key to remove from the cache

Returns ​

Promise<void>

Implementation of ​

Cache.delete

Defined in ​

packages/memory/src/cache/lib/multi.ts:54


get() ​

get<T>(key): Promise<undefined | T>

Get the cached value by key. Returns undefined if the key doesn't exist in the cache

Type Parameters ​

• T = unknown

Parameters ​

• key: string

Key to retrieve from the cache

Returns ​

Promise<undefined | T>

Cached value, or undefined if key doesn't exist

Implementation of ​

Cache.get

Defined in ​

packages/memory/src/cache/lib/multi.ts:39


has() ​

has(key): Promise<boolean>

Check if a given key exists in the cache

Parameters ​

• key: string

Key to check

Returns ​

Promise<boolean>

Implementation of ​

Cache.has

Defined in ​

packages/memory/src/cache/lib/multi.ts:59


set() ​

set(key, value): Promise<void>

Save the given value to the cache

Parameters ​

• key: string

Key to save in the cache

• value: unknown

Value to save to the cache. Can be any JavaScript primitive, plain object, or array

Returns ​

Promise<void>

Implementation of ​

Cache.set

Defined in ​

packages/memory/src/cache/lib/multi.ts:49