Redis provider settings reference
When you configure a Redis provider to host a Shared Session State Store or a Private Session State Store, you can add multiple attributes to the Redis provider configuration in the Sitecore Web.config file.
accessKey
accessKey
You configure the accessKey attribute with the primary or the secondary access key to the Redis cache.
applicationName
applicationName
You configure the applicationName attribute to private or shared to separate Private and Shared Session State Store data when hosted in the same Redis provider. The default value is empty, which makes Sitecore generate a value based on different system parameters.
compression
compression
You configure the compression attribute to true to enable compression of session state data. Compressing session state data reduces the amount of data that you need to transfer between the Sitecore instance and the Redis database but might cause some additional CPU overhead. The default value is false.
connectionString
connectionString
You configure the connectionString attribute to point to the Redis database. You can use a connection string name from the connectionStrings.config file (it must be called redis) or a valid StackExchange.Redis client connection string.
Instead of configuring the connectionString attribute, you can do one of the following:
-
Configure the
accessKey,connectionTimeoutInMilliseconds,host,operationTimeoutInMilliseconds,port, andsslattributes to replace the connection string. -
Configure the
settingsClassNameandsettingsMethodNameattributes to supply the connection string.
connectionTimeoutInMilliseconds
connectionTimeoutInMilliseconds
You configure the connectionTimeoutInMilliseconds attribute to override the connectTimeout setting in the Redis client. The default connectTimeout value is 5000 milliseconds. See the StackExchange.Redis client configuration model documentation for more information.
databaseId
databaseId
You configure the databaseId attribute to one of the 16 databases that the default Redis configuration supports (they are numbered 0-15). The default value is 0, which means that database 0 is used.
host
host
You configure the host attribute to point to your Redis cache.
maxConcurrencyLevel
maxConcurrencyLevel
You configure maxConcurrencyLevel to determine how many threads that run simultaneously to add expired sessions to the in-memory queue. A default value is used if the attribute is not present. Default value is SessionExpirationThreadCount multiplied by SessionExpirationBatchSize multiplied by 2.
operationTimeoutInMilliseconds
operationTimeoutInMilliseconds
You configure the operationTimeoutInMilliseconds attribute to override the syncTimeout setting in the Redis client. The default syncTimeout value is 5000 milliseconds. See the StackExhcange.Redis client configuration model documentation for more information.
pollingBatchSize
pollingBatchSize
You configure the pollingBatchSize attribute to the number of keys iterated with every call to the Redis cache. The default value is 200 keys. See the Redis SCAN documentation for more information.
pollingEnabled
pollingEnabled
You configure the pollingEnabled attribute to enable or disable Redis client processing of expired sessions. The default value is true.
pollingExpirationTimeout
pollingExpirationTimeout
You configure the pollingExpirationTimeout attribute to how long the Redis client ignores expired sessions before including them in Session End processing. The default value is 120 seconds.
pollingInterval
pollingInterval
You configure the pollingInterval attribute to how often the Redis client must check for expired sessions. The default value is 2 seconds.
pollingMaxExpiredSessionsPerSecond
pollingMaxExpiredSessionsPerSecond
You configure the pollingMaxExpiredSessionsPerSecond attribute to the number of expired sessions the Redis client processes per second. The default value is 0 seconds, which disables the setting.
pollingOnSlaves
pollingOnSlaves
You configure the pollingOnSlaves attribute to true to make Redis scan slave servers for expired sessions. This is only relevant if you have multiple Redis servers configured for replication in a master/slave relationship. The default value is false.
If you connect to a standalone Redis server configured for replication, you must add the allowAdmin="true" attribute when enabling pollingOnSlaves.
port
port
You configure the port attribute to to either your unprotected port or your SSL-protected port.
retryTimeoutInMilliseconds
retryTimeoutInMilliseconds
You configure the retryTimeoutInMilliseconds attribute to the timeout of the combined operation retries.
The Redis provider waits for 100 milliseconds before the first operation retry, and if that retry fails it doubles the timeout to 200 milliseconds and tries again. This procedure repeats with doubled timeouts until the retryTimeoutInMilliseconds value is reached. If the operation still has not succeeded, an exception returns control to the caller (depending on the throwOnError setting).
The default value is 5000 milliseconds.
settingsClassName
settingsClassName
You configure the settingsClassName attribute to an assembly and a class name that includes a settings method (see settingsMethodName).
settingsMethodName
settingsMethodName
You configure the settingsMethodName attribute to a method in the settings class (see settingsClassName). The method must not require any parameters, and it must be public, static, and return a [String] with a connectionString.
ssl
ssl
You configure the ssl attribute to enable or disable SSL-protected communication between the Redis client and the Redis cache. The default value is true.
You must specify the correct SSL port.
throwOnError
throwOnError
You configure the throwOnError setting to whether you want the Redis client to throw an exception in the event of a failure. The default value is true.