# RedisCacheOptions

<pre class="language-csharp" data-full-width="false"><code class="lang-csharp"><strong>/// &#x3C;summary>
</strong>/// Redis cache options
/// &#x3C;/summary>
public class RedisCacheOptions  
{
    /// &#x3C;summary>
    /// Gets or sets whether connect/configuration timeouts should be explicitly notified via a TimeoutException.
    /// Default value is true
    /// &#x3C;/summary>
    public bool AbortOnConnectFail { get; set; } 

    /// &#x3C;summary>
    /// Indicates whether admin operations should be allowed.
    /// Default value is false
    /// &#x3C;/summary>
    public bool AllowAdmin { get; set; } 

    /// &#x3C;summary>
    /// Specifies the time in milliseconds that the system should allow for asynchronous operations (defaults to SyncTimeout).
    /// &#x3C;/summary>
    public int AsyncTimeout { get; set; } 

    /// &#x3C;summary>
    /// Gets or sets whether the library should identify itself by library-name/version when possible.
    /// Default value is true
    /// &#x3C;/summary>
    public bool SetClientLibrary { get; set; } 
    
    /// &#x3C;summary>
    /// Gets or sets the library name to use for CLIENT SETINFO lib-name calls to Redis during handshake.
    /// Defaults value is "SE.Redis".
    /// &#x3C;/summary>
    /// &#x3C;remarks>If the value is null, empty or whitespace, then the value from the options-provideer is used;
    /// to disable the library name feature, use &#x3C;see cref="SetClientLibrary"/> instead.&#x3C;/remarks>
    public string? LibraryName { get; set; } 

    /// &#x3C;summary>
    /// Automatically encodes and decodes channels.
    /// &#x3C;/summary>
    public RedisChannel ChannelPrefix { get; set; } 
    
    /// &#x3C;summary>
    /// The client name to use for all connections.
    /// &#x3C;/summary>
    public string? ClientName { get; set; } 
    
    /// &#x3C;summary>
    /// Channel to use for broadcasting and listening for configuration change notification.
    /// Default value is "__Booksleeve_MasterChanged"
    /// &#x3C;/summary>
    public string? ConfigurationChannel { get; set; } 

    /// &#x3C;summary>
    /// Check configuration every n seconds (every minute by default).
    /// &#x3C;/summary>
    public int ConfigCheckSeconds { get; set; } 

    /// &#x3C;summary>
    /// Specifies the time in milliseconds that should be allowed for connection (defaults to 5 seconds unless SyncTimeout is higher).
    /// &#x3C;/summary>
    public int ConnectTimeoutInMilliseconds { get; set; } 

    /// &#x3C;summary>
    /// Specifies the default database to be used when calling &#x3C;see cref="ConnectionMultiplexer.GetDatabase(int, object)"/> without any parameters.
    /// &#x3C;/summary>
    public int? DefaultDatabase { get; set; } 

    /// &#x3C;summary>
    /// Specifies the time in seconds at which connections should be pinged to ensure validity.
    /// -1 Defaults to 60 Seconds
    /// &#x3C;/summary>
    public int KeepAliveInSeconds { get; set; } 

    /// &#x3C;summary>
    /// The username to use to authenticate with the server.
    /// &#x3C;/summary>
    public string? UserName { get; set; } 

    /// &#x3C;summary>
    /// The password to use to authenticate with the server.
    /// &#x3C;/summary>
    public string? Password { get; set; } 

    /// &#x3C;summary>
    /// Type of proxy to use (if any); for example &#x3C;see cref="StackExchange.Redis.Proxy"/>.
    /// Default value is Proxy.None
    /// &#x3C;/summary>
    public Proxy Proxy { get; set; } 

    /// &#x3C;summary>
    /// The backlog policy to be used for commands when a connection is unhealthy.
    /// &#x3C;/summary>
    public BacklogPolicy? BacklogPolicy { get; set; } 

    /// &#x3C;summary>
    /// Indicates whether endpoints should be resolved via DNS before connecting.
    /// If enabled the ConnectionMultiplexer will not re-resolve DNS when attempting to re-connect after a connection failure.
    /// Default value is false
    /// &#x3C;/summary>
    public bool ResolveDns { get; set; } 

    /// &#x3C;summary>
    /// The service name used to resolve a service via sentinel.
    /// &#x3C;/summary>
    public string? ServiceName { get; set; } 

    /// &#x3C;summary>
    /// Indicates whether the connection should be encrypted.
    /// &#x3C;/summary>
    public bool Ssl { get; set; } 

    /// &#x3C;summary>
    /// Gets or sets the SocketManager instance to be used with these options.
    /// If this is null a shared cross-multiplexer &#x3C;see cref="SocketManager"/> is used.
    /// &#x3C;/summary>
    /// &#x3C;remarks>
    /// This is only used when a &#x3C;see cref="ConnectionMultiplexer"/> is created.
    /// Modifying it afterwards will have no effect on already-created multiplexers.
    /// &#x3C;/remarks>
    public SocketManager? SocketManager { get; set; } 

    /// &#x3C;summary>
    /// A &#x3C;see cref="SslClientAuthenticationOptions"/> provider for a given host, for custom TLS connection options.
    /// Note: this overrides *all* other TLS and certificate settings, only for advanced use cases.
    /// &#x3C;/summary>
    public Func&#x3C;string, SslClientAuthenticationOptions>? SslClientAuthenticationOptions { get; set; } 

    /// &#x3C;summary>
    /// The target-host to use when validating SSL certificate; setting a value here enables SSL mode.
    /// &#x3C;/summary>
    public string? SslHost { get; set; } 

    /// &#x3C;summary>
    /// Configures which SSL/TLS protocols should be allowed.  If not set, defaults are chosen by the .NET framework.
    /// &#x3C;/summary>
    public SslProtocols SslProtocols { get; set; } 

    /// &#x3C;summary>
    /// Specifies the time in milliseconds that the system should allow for synchronous operations (defaults to 5 seconds).
    /// &#x3C;/summary>
    public int SyncTimeoutInSeconds { get; set; } 

    /// &#x3C;summary>
    /// Tie-breaker used to choose between primaries (must match the endpoint exactly).
    /// &#x3C;/summary>
    public string? TieBreaker { get; set; } 

    /// &#x3C;summary>
    /// The server version to assume.
    /// Default version is RedisFeatures.v3_0_0 &#x3C;see cref="RedisFeatures"/>
    /// &#x3C;/summary>
    public Version? Version { get; set; } 

    /// &#x3C;summary>
    /// A Boolean value that specifies whether the certificate revocation list is checked during authentication.
    /// &#x3C;/summary>
    public bool CheckCertificateRevocation { get; set; } 

    /// &#x3C;summary>
    /// Redis host:port endpoints
    /// &#x3C;/summary>
    public string[]? Hosts { get; set; } 

    /// &#x3C;summary>
    /// Controls how often the connection heartbeats. A heartbeat includes:
    /// - Evaluating if any messages have timed out
    /// - Evaluating connection status (checking for failures)
    /// - Sending a server message to keep the connection alive if needed
    /// &#x3C;/summary>
    /// &#x3C;remarks>
    /// This defaults to 1000 milliseconds and should not be changed for most use cases.
    /// If for example you want to evaluate whether commands have violated the &#x3C;see cref="RedisCacheOptions.AsyncTimeout"/> at a lower fidelity
    /// than 1000 milliseconds, you could lower this value.
    /// Be aware setting this very low incurs additional overhead of evaluating the above more often.
    /// &#x3C;/remarks>
    public TimeSpan HeartbeatInterval { get; set; } 

    /// &#x3C;summary>
    /// Reconnect retry policy
    /// &#x3C;/summary>
    public IReconnectRetryPolicy? ReconnectRetryPolicy { get; set; } 

    /// &#x3C;summary>
    /// Should exceptions include identifiable details? (key names, additional .Data annotations)
    /// Default value is true
    /// &#x3C;/summary>
    public bool IncludeDetailInExceptions { get; set; } 

    /// &#x3C;summary>
    /// Should exceptions include performance counter details?
    /// &#x3C;/summary>
    /// &#x3C;remarks>
    /// CPU usage, etc - note that this can be problematic on some platforms.
    /// Default value is false
    /// &#x3C;/remarks>
    public bool IncludePerformanceCountersInExceptions { get; set; } 

    /// &#x3C;summary>
    /// The number of times to repeat the initial connect cycle if no servers respond promptly.
    /// Default value is 3
    /// &#x3C;/summary>
    public int ConnectRetry { get; set; } 

    /// &#x3C;summary>
    /// Allows custom transport implementations, such as http-tunneling via a proxy.
    /// &#x3C;/summary>
    public Tunnel? Tunnel { get; set; } 

    /// &#x3C;summary>
    /// Allows modification of a &#x3C;see cref="Socket"/> between creation and connection.
    /// Passed in is the endpoint we're connecting to, which type of connection it is, and the socket itself.
    /// For example, a specific local IP endpoint could be bound, linger time altered, etc.
    /// &#x3C;/summary>
    public Action&#x3C;EndPoint, ConnectionType, Socket>? BeforeSocketConnect { get; set; } 

    /// &#x3C;summary>
    /// A LocalCertificateSelectionCallback delegate responsible for selecting the certificate used for authentication; note
    /// that this cannot be specified in the configuration-string.
    /// &#x3C;/summary>
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1009:DeclareEventHandlersCorrectly")]
    public event LocalCertificateSelectionCallback? CertificateSelection;

    /// &#x3C;summary>
    /// A RemoteCertificateValidationCallback delegate responsible for validating the certificate supplied by the remote party; note
    /// that this cannot be specified in the configuration-string.
    /// &#x3C;/summary>
    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1009:DeclareEventHandlersCorrectly")]
    public event RemoteCertificateValidationCallback? CertificateValidation;
}

</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eiffel.dev/features/caching/api/rediscacheoptions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
