Redis provider settings reference

Abstract

Use this table of Redis provider settings to configure your session state.

Use the following configuration options when you configure a shared or private session state in Sitecore:

Setting

Description

For example

connectionString (1)

Contains the connection string that Sitecore uses to connect to the session database.

Edit to specify the session state database that you want to use.

You can use a connection string name from connectionString or a valid StackExchange.Redis connection string.

connectionString="session"

connectionString="127.0.0.1:6380"

compression

Indicates that you want session state data to be compressed.

The default value is 'false'. Compressing session state data reduces the amount of data that you need to transfer between the database and the Sitecore instance. This may cause some additional CPU overhead.

compression="false"

settingsClassName (2)

Contains an assembly qualified class name that includes the settingsMethod, and returns the 'connectionString' value.

settingsClassName="Sitecore.SessionProvider.Redis.Settings, Sitecore.SessionProvider.Redis"

settingsMethodName (2)

Contains a method name that is defined in the settingsClass. The name must not require any parameters, it must be public, static, and have a return type of [String], which is the 'connectionString' value.

settingsMethodName="GetRedisConnectionString"

host (3)

Specifies your cache endpoint.

host="127.0.0.1"

port (3)

Uses either your non-ssl port or your ssl port, depending on the ssl settings.

port="6380"

accessKey (3)

Uses either the primary or secondary access key for your cache.

accessKey=" STKNJnBR9/DGaNoOATadRu/RY3PFFEZ7Xshk8B5NjNc="

ssl (3)

Secures that the cache/client communicates with ssl, if you ensure the value is set to 'true'. Otherwise set the value to 'false'. The default value is 'true'.

Important

Make sure you specify the correct port.

ssl="true"

connectionTimeoutInmilliseconds (3)

Allows you to override the connectTimeout setting in the StackExchange.Redis client. If the value is not specified, the default connectTimeout value is '5000'. For more information, see the StackExchange.Redis configuration model.

connectionTimeoutInMilliseconds = "5000"

operationTimeoutInMilliseconds (3)

Allows you to override the syncTimeout setting in the StackExchange.Redis client. If the timeout is not specified, the default syncTimeout value is '1000'. For more information, see the StackExchange.Redis configuration model.

operationTimeoutInMilliseconds = "1000"

throwOnError

Specifies whether to throw an exception in the event of a failure if you set the value to 'true'. If you want the operation to fail silently, set the value to 'false'. The default value is 'true'.

throwOnError="true"

retryTimeoutInMilliseconds

Specifies the maximum duration for the failed operations to retry during the retryTimeoutInMilliseconds interval. The first retry occurs after 20 milliseconds, then every second until the retryTimeoutInMilliseconds interval expires. Immediately after this interval, the operation retries one last time; if the operation still fails, the exception throws back to the caller (depending on the throwOnError setting). The default value is '5000'.

retryTimeoutInMilliseconds="5000"

databaseID

Specifies which database to use for the cache output data. If a database is not specified, the default value is '0'.

databaseId="0"

applicationName

Indicates whether the type of session state is private or shared. The default is empty.

applicationName="private"

pollingEnabled

Specifies whether to enable processing of expired sessions. The default value is 'true'.

pollingEnabled="true"

pollingInterval

Specifies the time interval in seconds that the session state provider uses to check if any sessions have expired. The default value is '2'

pollingInterval="2"

pollingOnSlaves

Specifies which servers to scan for expired sessions. For example, if there are no Redis slave servers, it will scan the master servers for expired sessions. The default value is 'false'.

pollingOnSlaves="false"

pollingBatchSize

Specifies the number of keys iterated with every call to the Redis cache, when you retrieve keys from the key space. The default value is '200', but this is just a hint. For more information on the Count and Match options while using SCAN, see: http://redis.io/commands/scan

pollingBatchSize="200"

pollingExpirationTimeout

Specifies the interval of time that the expired session is locked, (so that it is not used during Session End processing). The default value in seconds is '120'.

pollingExpirationTimeout="120"

pollingMaxExpiredSessionsPerSecond

Limits the number of expired sessions that are processed per second. The default value is '0'.

Note

The value '0' disables limiting.

pollingMaxExpiredSessionsPerSecond="0"

Key

(1) Specify the 'Redis' connection string in connectionString.

(2) (Optional) Instead of using the connectionString configuration, you can use: settingsClassName, settingsMethodName.

(3) (Optional) Instead of using the connectionString configuration, you can use: host, port, accessKey, ssl, connectionTimeoutInMilliseconds, and operationTimeoutInMilliseconds.

Note

If you enable pollingOnSlaves, you must set allowAdmin="true" when specifying the connection to a standalone Redis server with replication configured.

For further information use the  walkthrough: configuring a shared session state database using the Redis provider or the walkthrough: configuring a private session state database using the Redis provider.