Skip to content

Commit fcfd183

Browse files
authored
Update pkg readme (#510)
1 parent ab4980d commit fcfd183

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

BitFaster.Caching/ReadMe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ var lru = new ConcurrentLru<string, SomeItem>(capacity);
1515
var value = lru.GetOrAdd("key", (key) => new SomeItem(key));
1616
```
1717

18+
Optionally configure `ConcurrentLru` with a [time-based eviction policy](https://github.com/bitfaster/BitFaster.Caching/wiki/ConcurrentLru:-Time%E2%80%90based-eviction), either:
19+
- Expire after write
20+
- Expire after access
21+
- Calculate an expiry time per item
22+
1823
## ConcurrentLfu
1924

2025
`ConcurrentLfu` is a drop in replacement for `ConcurrentDictionary`, but with bounded size enforced by the [W-TinyLFU admission policy](https://arxiv.org/pdf/1512.00727.pdf). `ConcurrentLfu` has near optimal hit rate and high scalability. Reads and writes are buffered then replayed asynchronously to mitigate lock contention.

0 commit comments

Comments
 (0)