How to set redis connection timeout?

Where in the configuration file to set the connection timeout for Redis?

I know that there is a timeout parameter in the configuration file, but this only applies to downtime. I want the timeout applied when I want to read redis. I want it to disconnect only after N seconds, and not by default.

+4
source share
1 answer

For those who are still looking for this, you can specify connectionTimeout in the redis connection string, as shown below.

<add key="RedisConnectionString" value="your-redis-server,abortConnect=false,connectTimeout=1000,ssl=false,,password=your-password" /> 
+7
source

All Articles