• CacheManager
  • Documentation
  • Api Docs
  • MichaCo.net
    Show / Hide Table of Contents

    Class RedisConfiguration

    RedisConfiguration will be used for configuring e.g. StackExchange.Redis by code or configuration file.

    The element was added only because StackExchange.Redis doesn't support configuration via web/app.config

    Inheritance
    Object
    RedisConfiguration
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace:CacheManager.Redis
    Assembly:CacheManager.StackExchange.Redis.dll
    Syntax
    public class RedisConfiguration

    Constructors

    | Improve this Doc View Source

    RedisConfiguration()

    Initializes a new instance of the RedisConfiguration class.

    Declaration
    public RedisConfiguration()
    | Improve this Doc View Source

    RedisConfiguration(String, IList<ServerEndPoint>, Int32, String, Boolean, String, Int32, Boolean, Boolean, Boolean, String)

    Initializes a new instance of the RedisConfiguration class.

    Declaration
    public RedisConfiguration(string key, IList<ServerEndPoint> endpoints, int database = 0, string password = null, bool isSsl = false, string sslHost = null, int connectionTimeout = 5000, bool allowAdmin = false, bool keyspaceNotificationsEnabled = false, bool twemproxyEnabled = false, string strictCompatibilityModeVersion = null)
    Parameters
    Type Name Description
    String key

    The configuration key which will be used by the cache handle to find a configuration for the cache handle's name.

    IList<ServerEndPoint> endpoints

    The list of ServerEndPoint s to be used to connect to Redis server.

    Int32 database

    The Redis database index.

    String password

    The password of the Redis server.

    Boolean isSsl

    If true instructs the cache to use SSL encryption.

    String sslHost

    If specified, the connection will set the SSL host.

    Int32 connectionTimeout

    Sets the timeout used for connect operations.

    Boolean allowAdmin

    If set to True it enables the cache to use features which might be risky. Clear for example.

    Boolean keyspaceNotificationsEnabled

    Enables keyspace notifications to react on eviction/expiration of items.

    Boolean twemproxyEnabled

    Enables Twemproxy mode.

    String strictCompatibilityModeVersion

    Gets or sets a version number to eventually reduce the avaible features accessible by cachemanager.

    | Improve this Doc View Source

    RedisConfiguration(String, String, Int32, Boolean, String)

    Initializes a new instance of the RedisConfiguration class.

    Declaration
    public RedisConfiguration(string key, string connectionString, int database = 0, bool keyspaceNotificationsEnabled = false, string strictCompatibilityModeVersion = null)
    Parameters
    Type Name Description
    String key

    The configuration key which will be used by the cache handle to find a configuration for the cache handle's name.

    String connectionString

    Instead of specifying all the properties, this can also be done via one connection string.

    Int32 database

    The redis database to use.

    Boolean keyspaceNotificationsEnabled

    Enables keyspace notifications to react on eviction/expiration of items.

    String strictCompatibilityModeVersion

    Gets or sets a version number to eventually reduce the avaible features accessible by cachemanager.

    Properties

    | Improve this Doc View Source

    AllowAdmin

    Gets or sets a value indicating whether to allow the connection to run certain 'risky' commands, or not.

    cache.Clear requires this to be set to true because we will flush the Redis database.

    Declaration
    public bool AllowAdmin { get; set; }
    Property Value
    Type Description
    Boolean

    true if 'risky' commands are allowed; otherwise, false.

    | Improve this Doc View Source

    ConfigurationOptions

    Gets the StackExchange.Redis.ConfigurationOptions defined by this configuration.

    Declaration
    [CLSCompliant(false)]
    public ConfigurationOptions ConfigurationOptions { get; }
    Property Value
    Type Description
    StackExchange.Redis.ConfigurationOptions
    | Improve this Doc View Source

    ConnectionString

    Gets or sets the connection string.

    Declaration
    public string ConnectionString { get; set; }
    Property Value
    Type Description
    String

    The connection string.

    | Improve this Doc View Source

    ConnectionTimeout

    Gets or sets the timeout for any connect operations.

    Declaration
    public int ConnectionTimeout { get; set; }
    Property Value
    Type Description
    Int32

    The connection timeout.

    | Improve this Doc View Source

    Database

    Gets or sets the Redis database index the cache will use.

    Declaration
    public int Database { get; set; }
    Property Value
    Type Description
    Int32

    The database.

    | Improve this Doc View Source

    Endpoints

    Gets the list of endpoints to be used to connect to the Redis server.

    Declaration
    public IList<ServerEndPoint> Endpoints { get; }
    Property Value
    Type Description
    IList<ServerEndPoint>

    The endpoints.

    | Improve this Doc View Source

    IsSsl

    Gets or sets a value indicating whether to use SSL encryption.

    Declaration
    public bool IsSsl { get; set; }
    Property Value
    Type Description
    Boolean

    true if this instance is SSL; otherwise, false.

    | Improve this Doc View Source

    Key

    Gets or sets the identifier for the redis configuration.

    This might have to match with the cache handle's name to make the cache handle use this configuration.

    Declaration
    public string Key { get; set; }
    Property Value
    Type Description
    String

    The key.

    | Improve this Doc View Source

    KeyspaceNotificationsEnabled

    Gets or sets a value indicating whether the redis cache handle should use keyspace notifications to react on evictions or expired events from redis and then forward those events to the cache manager. See https://redis.io/topics/notifications for technical details.

    To use this feature, you might have to enable this feature on your redis server(s).

    Declaration
    public bool KeyspaceNotificationsEnabled { get; set; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Password

    Gets or sets the password to be used to connect to the Redis server.

    Declaration
    public string Password { get; set; }
    Property Value
    Type Description
    String

    The password.

    | Improve this Doc View Source

    SslHost

    Gets or sets the SSL Host. If set, it will enforce this particular host on the server's certificate.

    Declaration
    public string SslHost { get; set; }
    Property Value
    Type Description
    String

    The SSL host.

    | Improve this Doc View Source

    StrictCompatibilityModeVersion

    Gets or sets a version number to eventually reduce the avaible features accessible by cachemanager. E.g. set this to "2.4" to disable LUA support.

    Declaration
    public string StrictCompatibilityModeVersion { get; set; }
    Property Value
    Type Description
    String
    Remarks

    This can also be used when automatic feature detection is not possible. Which is the case for example if TwemProxy is used, because the servers collection. to query the features, is not available/supported. CacheManager per default falls back to a version which supports LUA. If you are using a Redis server behind TwemPoxy which does not allow LUA, use this property!

    | Improve this Doc View Source

    TwemproxyEnabled

    Gets or sets a value to indicate if Termproxy is being used.

    Declaration
    public bool TwemproxyEnabled { get; set; }
    Property Value
    Type Description
    Boolean
    • Improve this Doc
    • View Source
    © 2025 by Michael Conrad. All rights reserved. - MichaCo.net