You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+65-23Lines changed: 65 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,69 +1,110 @@
1
-
# Polly.Caching.IDistributedCache
1
+
# Polly.Caching.Distributed
2
2
3
-
This repo contains the `Microsoft.Extensions.Caching.Distributed.IDistributedCache`plugin for the [Polly](https://github.com/App-vNext/Polly)[Cache policy](https://github.com/App-vNext/Polly/wiki/Cache). It targets .NET Standard 1.1.
3
+
This repo contains the `Microsoft.Extensions.Caching.Distributed.IDistributedCache`provider for the [Polly](https://github.com/App-vNext/Polly)[Cache policy](https://github.com/App-vNext/Polly/wiki/Cache). The current version targets .NET Standard 1.1 and .NET Standard 2.0.
[Polly](https://github.com/App-vNext/Polly) is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, Cache aside and Fallback in a fluent and thread-safe manner. Polly targets .NET 4.0, .NET 4.5 and .NET Standard 1.1.
9
+
[Polly](https://github.com/App-vNext/Polly) is a .NET resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, Cache aside and Fallback in a fluent and thread-safe manner. Polly targets .NET Standard 1.1 and .NET Standard 2.0.
10
10
11
-
Polly is a member of the [.NET Foundation](https://www.dotnetfoundation.org/about)!
11
+
Polly is a member of the [.NET Foundation](https://www.dotnetfoundation.org/about).
12
12
13
13
**Keep up to date with new feature announcements, tips & tricks, and other news through [www.thepollyproject.org](http://www.thepollyproject.org)**
This project, Polly.Caching.IDistributedCache, allows you to use Polly's `CachePolicy` with [implementations of](https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed) .Net Standard's [`IDistributedCache`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.distributed.idistributedcache).
19
+
This project, Polly.Caching.Distributed, allows you to use Polly's `CachePolicy` with [implementations of](https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed) .Net Standard's [`IDistributedCache`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.distributed.idistributedcache).
20
20
21
-
# Installing Polly.Caching.IDistributedCache via NuGet
+[Polly](nuget.org/packages/polly) v5.4.0 or above.
38
34
+[Microsoft.Extensions.Caching.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Abstractions/) v1.1.2 or above.
39
35
40
-
# How to use the Polly.Caching.IDistributedCache plugin
36
+
Polly.Caching.Distributed >=v2.0 requires:
37
+
38
+
+[Polly](nuget.org/packages/polly) v6.0.1 or above.
39
+
+[Microsoft.Extensions.Caching.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.Caching.Abstractions/) v2.0.2 or above.
40
+
41
+
# How to use the Polly.Caching.Distributed plugin
41
42
42
43
These notes assume you are familiar with using the .Net Standard `IDistributedCache` implementations. For information, see: https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed . As described on that page, Microsoft provide a Redis implementation and an SQL server implementation for `IDistributedCache`.
43
44
44
45
Assuming you have an instance `IDistributedCache distributedCache` in hand (perhaps just configured and instantiated, perhaps provided to local code by Dependency Injection):
45
46
47
+
46
48
```csharp
47
-
// Create a Polly cache policy for caching string results, using that `IDistributedCache` instance.
// In this example we choose to pass a whole PolicyRegistry by dependency injection rather than the individual policy, on the assumption the webapp will probably use multiple policies across the app.
@@ -86,6 +127,7 @@ For details of changes by release see the [change log](CHANGELOG.md).
86
127
87
128
*[@seanfarrow](https://github.com/seanfarrow) and [@reisenberger](https://github.com/reisenberger) - Initial caching architecture in the main Polly repo
0 commit comments