Skip to content

Commit 3105b18

Browse files
authored
Merge pull request #1 from albumprinter/feature/initial-readme-md
Update initial README.md information
2 parents 14ab044 + 38e30db commit 3105b18

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1-
# DynamoDb IDistributedCache Implementation
2-
<Placeholder>
1+
# Albelli.Extensions.Caching.DynamoDb
2+
This library offers an implementation of IDistributedCache with a DynamoDb back-end.
3+
It makes use of the TTL functionality to get remove the stale cache keys.
4+
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.
5+
6+
## Considerations
7+
8+
- Deleting DynamoDB items with an expired TTL takes up to 48 hours. There is a soft invalidation in the code to check whether the item has expired or not.
9+
- Sliding expiration is WIP and experimental. It works in such a way that the TTL is refreshed(by the amount of the sliding expiration) when you do a GetCacheKey and the TTL is about to expire in (SlidingExpirationDuration / 2) seconds.
10+
Example:
11+
Sliding expiration is set to 30 mins.
12+
The TTL is CurrentTime + 14 mins( < SlidingExpirationDuration / 2).
13+
Doing a GET will refresh the TTL to CurrentTime + 14 mins + 30 mins.
14+
A subsequent GET will not refresh the key until the condition is met again.
15+
- While methods are thread-safe, data race conditions are possible. It's up to the caller to manage them correctly.
16+
- Sync methods are disabled by default due to the fact that Amazon's DynamoDb client uses HttpClient internally, which lacks sync methods. There is an override that will enable them, but doing so is not recommended.
17+
- The library is still **quite raw**. Any pull requests, ideas and feedback are encouraged.
18+
19+

0 commit comments

Comments
 (0)