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
+26
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,33 @@
1
+
1
2
# Albelli.Extensions.Caching.DynamoDb
2
3
This library offers an implementation of IDistributedCache with a DynamoDb back-end.
3
4
It makes use of the TTL functionality to get remove the stale cache keys.
4
5
IDistributedCache is a low-level interface used by cache-related consumers, such as Polly. Microsoft also provides a set of extension methods that simplify common workflows.
Then you can inject it through Microsoft's DI container. Example:
12
+
13
+
services.AddDynamoDbCache(
14
+
o =>
15
+
{
16
+
o.TableName = "CustomerSubscriptions-Caching";
17
+
});
18
+
That's it! This will be injected as a singleton. Afterwards, you have access to the IDistributedCache in your application.
19
+
Bear in mind, this has a dependency on AmazonDynamoDBClient client.
20
+
You can either make sure it's injected in the DI engine or use:
21
+
22
+
23
+
services.AddDynamoDbCache(
24
+
o =>
25
+
{
26
+
...
27
+
o.CustomDynamoDbClient = new AmazonDynamoDBClient();
28
+
...
29
+
});
30
+
6
31
## Considerations
7
32
- There is no optimistic locking(or locking of any kind). If this is a big problem, using a different provider(such as Redis with WATCH) might be better for your use case.
8
33
- Eventual consistency is used.
@@ -17,3 +42,4 @@ IDistributedCache is a low-level interface used by cache-related consumers, such
17
42
- The library is still **quite raw**. Any pull requests, ideas and feedback are encouraged.
0 commit comments