Skip to content

@egain/ai-agent-sdk API Reference - v0.3.2 / CacheConfig

Interface: CacheConfig ​

Cache configuration options

Table of contents ​

Properties ​

Properties ​

enabled ​

• Optional enabled: boolean

Whether caching is enabled

Default

ts
true

Defined in ​

core/api/ApiHelper.ts:15


storageType ​

• Optional storageType: CacheStorageType

Storage type: 'local' (localStorage), 'session' (sessionStorage), or 'memory'

Default

ts
'session'

Defined in ​

core/api/ApiHelper.ts:21


keyPrefix ​

• Optional keyPrefix: string

Prefix for cache keys

Default

ts
'egain_aiagent_cache_'

Defined in ​

core/api/ApiHelper.ts:27


ttl ​

• Optional ttl: number

Time-to-live in milliseconds

Default

ts
300000 (5 minutes)

Defined in ​

core/api/ApiHelper.ts:33


adapter ​

• Optional adapter: CacheAdapter

Custom cache adapter instance When provided, this adapter will be used instead of the built-in adapters. The SDK manages all caching logic (TTL, keys, invalidation) - the adapter only provides the underlying storage mechanism with synchronous get/set.

Defined in ​

core/api/ApiHelper.ts:41

Released under the MIT License.