我正在使用分布式Redis缓存暂时缓存一些用户数据。目前我正在我的开发环境中本地测试应用程序。我本地计算机上的Redis-Server没有密码,但在生产中我使用的是随机生成的密码。
如何使用密码连接Redis服务器?
My Startup.cs:
//Add Redis
services.AddDistributedRedisCache(options =>
{
options.Configuration = "127.0.0.1:6379";
options.InstanceName = "Portal";
});
答案 0 :(得分:8)
str
客户端构建于Microsoft.Extensions.Caching.Redis
之上。这意味着https://github.com/mebjas/CSRF-Protector-PHP/wiki/How-to-use用于指定密码和任何其他选项,例如:
StackExchange.Redis