Redis Cache
You can use the secure Azure Redis cache to configure a shared or private session state for your Sitecore solution.
A shared session state database - shares data across multiple sessions. For example, the Redis cache collects data related to contacts and devices, and saves the information to the session state database.
Deploy a shared session database
- Choose between Azure Redis or Redis on premise. You can provision Azure Redis by using the instructions on the Microsoft Azure website or with Azure PowerShell.
- Go to the <sitename>\Website\App_Config folder, open the ConnectionStrings.config file, and add the following connection string:
- Configure the connection string so that it points to your session database.
- Save your changes.
Configure Sitecore
To configure Sitecore to instead use the shared session state provider for Redis:
- In your website root folder, go to App_Config\Sitecore\Marketing.Tracking folder.
- Open the Sitecore.Analytics.Tracking.Config file.
- Locate the line where you can define the default shared session state provider using the following path: sitecore/tracking/sharedSessionState.
- Update the sharedSessionState section to use Redis as the defaultProvider (not inProc ). You must also, change the name attribute value to redis, as shown in the following example:
<sharedSessionState defaultProvider="redis">
<providers>
<clear />
<add name="redis"
type="Sitecore.SessionProvider.Redis.RedisSessionStateProvider,
Sitecore.SessionProvider.Redis"
connectionString="sharedSession"
pollingInterval="2"
applicationName="shared" />
</providers>
</sharedSessionState>
A private session state database - the Redis cache collects all data related to a specific interaction and saves it to the session state database. Interactions include: viewed pages, converted goals, triggered campaigns, or accumulated engagement points.
Configure Sitecore
To configure Sitecore to use the private Session state store provider for Redis:
- Go to your site root folder, open the web.config file, and locate the sesssionState section:
<sessionState mode="InProc" cookieless="false" timeout="20">
- In the sessionState section, update the customProvider attribute to use the Redis provider instead of InProc, as shown in the following example. Also, change the value of the name attribute value to redis:
<sessionState mode="Custom" customProvider="redis" timeout="20">
<providers>
<add name="redis"
type="Sitecore.SessionProvider.Redis.RedisSessionStateProvider,
Sitecore.SessionProvider.Redis"
connectionString="session"
pollingInterval="2"
applicationName="private"/>
</providers>
</sessionState>
Comments
Post a Comment