# Interface: CacheConfig

Configuration for caching

## Indexable[​](#indexable "Direct link to Indexable")

```ts
[key: string]: unknown

```

## Properties[​](#properties "Direct link to Properties")

### cacheKey?[​](#cachekey "Direct link to cacheKey?")

```ts
optional cacheKey: (string | number | object)[];

```

Cache key

***

### cleanupProbability?[​](#cleanupprobability "Direct link to cleanupProbability?")

```ts
optional cleanupProbability: number;

```

Probability (0-1) of triggering cleanup on each get operation

***

### enabled?[​](#enabled "Direct link to enabled?")

```ts
optional enabled: boolean;

```

Whether caching is enabled

***

### evictionCheckProbability?[​](#evictioncheckprobability "Direct link to evictionCheckProbability?")

```ts
optional evictionCheckProbability: number;

```

Probability (0-1) of checking total bytes on each write operation

***

### maxBytes?[​](#maxbytes "Direct link to maxBytes?")

```ts
optional maxBytes: number;

```

Maximum number of bytes in the cache

***

### maxEntryBytes?[​](#maxentrybytes "Direct link to maxEntryBytes?")

```ts
optional maxEntryBytes: number;

```

Maximum number of bytes per entry in the cache

***

### maxSize?[​](#maxsize "Direct link to maxSize?")

```ts
optional maxSize: number;

```

Maximum number of entries in the cache

***

### storage?[​](#storage "Direct link to storage?")

```ts
optional storage: CacheStorage;

```

Cache Storage provider instance

***

### strictPersistence?[​](#strictpersistence "Direct link to strictPersistence?")

```ts
optional strictPersistence: boolean;

```

Whether to enforce strict persistence

***

### telemetry?[​](#telemetry "Direct link to telemetry?")

```ts
optional telemetry: TelemetryOptions;

```

Telemetry configuration

***

### ttl?[​](#ttl "Direct link to ttl?")

```ts
optional ttl: number;

```

Time to live in seconds
