# ResponseCacheSettings

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.responsecachesettings/
> Summary: ResponseCacheSettings: Response caching settings for a ModelBinding.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

Response caching settings for a [ModelBinding](/api/tracon.modelbinding/).

```csharp
public sealed record ResponseCacheSettings : IEquatable<ResponseCacheSettings>
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.responsecachesettings/">ResponseCacheSettings</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.iequatable-1">IEquatable&lt;ResponseCacheSettings&gt;</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

Disabled by default: with no cache configured, today's behavior is
preserved exactly — every call reaches the model, and no cache ring is
added to the pipeline.

The cache key is tenant-, provider- and tool-set-aware; it is not the raw
key `Microsoft.Extensions.AI.DistributedCachingChatClient` computes on
its own. Two agents with a different [AgentDefinition.ToolNames](/api/tracon.agentdefinition/#Tracon_AgentDefinition_ToolNames)
never share a cached response.

## Constructors

### <a id="Tracon_ResponseCacheSettings__ctor"></a> ResponseCacheSettings\(\)

```csharp
public ResponseCacheSettings()
```

## Properties

### <a id="Tracon_ResponseCacheSettings_Enabled"></a> Enabled

Gets whether the cache ring is added to the pipeline.

```csharp
public bool Enabled { get; init; }
```

#### Property Value

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_ResponseCacheSettings_Lifetime"></a> Lifetime

Gets how long a cached response stays valid.

```csharp
public TimeSpan Lifetime { get; init; }
```

#### Property Value

 [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan)

#### Remarks

A model version can change under the same name, and a cache hit skips
the content guard (it never reaches the model call it would inspect);
this bounds both risks to a limited window instead of leaving a cached
response valid forever.

## Methods

### <a id="Tracon_ResponseCacheSettings_Equals_System_Object_"></a> Equals\(object?\)

```csharp
public override bool Equals(object? obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_ResponseCacheSettings_Equals_Tracon_ResponseCacheSettings_"></a> Equals\(ResponseCacheSettings?\)

```csharp
public bool Equals(ResponseCacheSettings? other)
```

#### Parameters

`other` [ResponseCacheSettings](/api/tracon.responsecachesettings/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_ResponseCacheSettings_GetHashCode"></a> GetHashCode\(\)

```csharp
public override int GetHashCode()
```

#### Returns

 [int](https://learn.microsoft.com/dotnet/api/system.int32)

### <a id="Tracon_ResponseCacheSettings_ToString"></a> ToString\(\)

```csharp
public override string ToString()
```

#### Returns

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Operators

### <a id="Tracon_ResponseCacheSettings_op_Equality_Tracon_ResponseCacheSettings_Tracon_ResponseCacheSettings_"></a> operator ==\(ResponseCacheSettings?, ResponseCacheSettings?\)

```csharp
public static bool operator ==(ResponseCacheSettings? left, ResponseCacheSettings? right)
```

#### Parameters

`left` [ResponseCacheSettings](/api/tracon.responsecachesettings/)?

`right` [ResponseCacheSettings](/api/tracon.responsecachesettings/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### <a id="Tracon_ResponseCacheSettings_op_Inequality_Tracon_ResponseCacheSettings_Tracon_ResponseCacheSettings_"></a> operator \!=\(ResponseCacheSettings?, ResponseCacheSettings?\)

```csharp
public static bool operator !=(ResponseCacheSettings? left, ResponseCacheSettings? right)
```

#### Parameters

`left` [ResponseCacheSettings](/api/tracon.responsecachesettings/)?

`right` [ResponseCacheSettings](/api/tracon.responsecachesettings/)?

#### Returns

 [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
