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

# IDistributedCache

> Authenticated task store over whatever IDistributedCache you already registered. Specified; not in this repository yet.

> [!WARNING]
>
> `McpEssentials.DistributedCache` is specified and is not in this repository yet.

Use this when the host already registered `IDistributedCache` (Redis, NCache, SQL Server cache, FusionCache, …) and you want tasks on that abstraction. Prefer [Redis](https://ai.easyaf.dev/mcpessentials/guides/stores/redis.md) when the cache is Redis and you need pub/sub.

## Intended how-to

1. Add `McpEssentials.DistributedCache`.
2. Serialize the canonical `StoredMcpTask` record with source-generated JSON. Key `mcp:task:{taskId}`.
3. Register the store as a singleton with the same current-user factory as [Authenticated tasks](https://ai.easyaf.dev/mcpessentials/guides/authenticated-tasks.md).
4. `IDistributedCache` has no pub/sub. For multi-node `ElicitAsync`, register [`IMcpTaskInputSignalBus`](https://ai.easyaf.dev/mcpessentials/api-reference/CloudNimble/McpEssentials/Core/Tasks/IMcpTaskInputSignalBus). Single-node hosts can skip the bus.

## TTL

Set cache entry expiry from `DiscardAfter` (`CreatedAt + 2×TimeToLive`). A missing key is not found.

See [Stores](https://ai.easyaf.dev/mcpessentials/guides/stores.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.