# Cache

> **Class** in `langsmith`

📖 [View in docs](https://reference.langchain.com/python/langsmith/prompt_cache/Cache)

Deprecated alias for PromptCache. Use PromptCache instead.

## Signature

```python
Cache(
    self,
    *,
    max_size: int = DEFAULT_PROMPT_CACHE_MAX_SIZE,
    ttl_seconds: Optional[float] = DEFAULT_PROMPT_CACHE_TTL_SECONDS,
    refresh_interval_seconds: float = DEFAULT_PROMPT_CACHE_REFRESH_INTERVAL_SECONDS,
)
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `max_size` | `int` | No | Maximum entries in cache (LRU eviction when exceeded). (default: `DEFAULT_PROMPT_CACHE_MAX_SIZE`) |
| `ttl_seconds` | `Optional[float]` | No | Time before entry is considered stale. (default: `DEFAULT_PROMPT_CACHE_TTL_SECONDS`) |
| `refresh_interval_seconds` | `float` | No | How often to check for stale entries. (default: `DEFAULT_PROMPT_CACHE_REFRESH_INTERVAL_SECONDS`) |

## Extends

- `PromptCache`

## Constructors

```python
__init__(
    self,
    *,
    max_size: int = DEFAULT_PROMPT_CACHE_MAX_SIZE,
    ttl_seconds: Optional[float] = DEFAULT_PROMPT_CACHE_TTL_SECONDS,
    refresh_interval_seconds: float = DEFAULT_PROMPT_CACHE_REFRESH_INTERVAL_SECONDS,
) -> None
```

| Name | Type |
|------|------|
| `max_size` | `int` |
| `ttl_seconds` | `Optional[float]` |
| `refresh_interval_seconds` | `float` |


---

[View source on GitHub](https://github.com/langchain-ai/langsmith-sdk/blob/cf0366388873e33ef593235c1d0c7e561db79cfb/python/langsmith/prompt_cache.py#L684)