Skip to content
On this page

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 / CacheRedis

Class: CacheRedis

Implements

Constructors

new CacheRedis(config)

new CacheRedis(config): CacheRedis

Parameters

config: Omit<CacheConfigRedis, "type">

Returns

CacheRedis

Source

packages/memory/src/cache/lib/redis.ts:9

Properties

store

private store: Kv

Source

packages/memory/src/cache/lib/redis.ts:7

Methods

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

Source

packages/memory/src/cache/lib/redis.ts:21


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

Source

packages/memory/src/cache/lib/redis.ts:13


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

Source

packages/memory/src/cache/lib/redis.ts:25


set()

set<T>(key, value): Promise<void>

Save the given value to the cache

Type parameters

T = unknown

Parameters

key: string

Key to save in the cache

value: T

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

Returns

Promise<void>

Implementation of

Cache.set

Source

packages/memory/src/cache/lib/redis.ts:17