> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Caching Config • Rust AI Agent SDK

> CachingConfig: Configuration for caching behavior

# CachingConfig

> Defined in the [**config**](../modules/config) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Configuration for caching behavior

## Fields

| Name             | Type                | Description                               |
| ---------------- | ------------------- | ----------------------------------------- |
| `enabled`        | `bool`              | Enable response caching                   |
| `prompt_caching` | `bool`              | Enable prompt caching (provider-specific) |
| `ttl_secs`       | `Option&lt;u64&gt;` | Cache TTL in seconds                      |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new() -> Self
```

Create a new caching config

### `disabled`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn disabled(mut self) -> Self
```

Disable caching

### `with_prompt_caching`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn with_prompt_caching(mut self) -> Self
```

Enable prompt caching

### `ttl`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn ttl(mut self, secs: u64) -> Self
```

Set TTL

**Parameters:**

| Name   | Type  |
| ------ | ----- |
| `secs` | `u64` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/config.rs#L643">
  `praisonai/src/config.rs` at line 643
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />
</CardGroup>
