Skip to content

Commit 01049e9

Browse files
authored
Update README.md
1 parent c8867d9 commit 01049e9

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
11
# ServiceStackRedisCache
22

3-
Distributed cache implementation of Microsoft.Extensions.Caching.Distributed.IDistributedCache using ServiceStack.Redis.
3+
Distributed cache implementation of Microsoft.Extensions.Caching.Distributed.IDistributedCache using ServiceStack.Redis.Core.
4+
5+
### Configure
6+
7+
Startup.cs
8+
9+
```cs
10+
public void ConfigureServices(IServiceCollection services)
11+
{
12+
services.AddDistributedServiceStackRedisCache(options =>
13+
{
14+
Configuration.GetSection("redis").Bind(options);
15+
//Workaround for deadlock when resolving host name
16+
IPAddress ip;
17+
if (!IPAddress.TryParse(options.Host, out ip))
18+
{
19+
options.Host = Dns.GetHostAddressesAsync(options.Host)
20+
.Result.FirstOrDefault(a => a.AddressFamily == AddressFamily.InterNetwork).ToString();
21+
}
22+
});
23+
}
24+
```
25+
appsettings.json
26+
27+
```json
28+
{
29+
"redis": {
30+
"Host": "xxx",
31+
"Password": "xxx"
32+
}
33+
}
34+
```

0 commit comments

Comments
 (0)