File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change 1
1
# ServiceStackRedisCache
2
2
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
+ ```
You can’t perform that action at this time.
0 commit comments