Directus / @directus/memory / index / CacheLocal
Class: CacheLocal ​
Defined in: packages/memory/src/cache/lib/local.ts:5
Implements ​
Constructors ​
new CacheLocal() ​
new CacheLocal(
config
):CacheLocal
Defined in: packages/memory/src/cache/lib/local.ts:8
Parameters ​
config ​
Omit
<CacheConfigLocal
, "type"
>
Returns ​
Methods ​
clear() ​
clear():
Promise
<void
>
Defined in: packages/memory/src/cache/lib/local.ts:28
Remove all keys from the cache
Returns ​
Promise
<void
>
Implementation of ​
delete() ​
delete(
key
):Promise
<void
>
Defined in: packages/memory/src/cache/lib/local.ts:20
Remove the given key from the cache
Parameters ​
key ​
string
Key to remove from the cache
Returns ​
Promise
<void
>
Implementation of ​
get() ​
get<
T
>(key
):Promise
<undefined
|T
>
Defined in: packages/memory/src/cache/lib/local.ts:12
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 ​
has() ​
has(
key
):Promise
<boolean
>
Defined in: packages/memory/src/cache/lib/local.ts:24
Check if a given key exists in the cache
Parameters ​
key ​
string
Key to check
Returns ​
Promise
<boolean
>
Implementation of ​
set() ​
set(
key
,value
):Promise
<void
>
Defined in: packages/memory/src/cache/lib/local.ts:16
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
>