Skip to content

Commit

Permalink
#25: Update Readme for clarity on TTL behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
ReneKroon authored Jan 14, 2020
1 parent 81b1410 commit 1e1b66b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ TTLCache is a simple key/value cache in golang with the following functions:
5. Can trigger callback on key expiration
6. Cleanup resources by calling `Close()` at end of lifecycle.

Note (issue #25): by default, due to historic reasons, the TTL will be reset on each cache hit and you need to explicitly configure the cache to use a TTL that will not get extended.

[![Build Status](https://travis-ci.org/ReneKroon/ttlcache.svg?branch=master)](https://travis-ci.org/ReneKroon/ttlcache)

#### Usage
Expand Down Expand Up @@ -63,7 +65,7 @@ TTLCache was forked from [wunderlist/ttlcache](https://github.com/wunderlist/ttl
The main differences are:

1. A item can store any kind of object, previously, only strings could be saved
2. Optionally, you can add callbacks to: check if a value should expire, be notified if a value expires, and be notified when new values are added to the cache
2. Optionally, you can add callbacks too: check if a value should expire, be notified if a value expires, and be notified when new values are added to the cache
3. The expiration can be either global or per item
4. Can exist items without expiration time
5. Expirations and callbacks are realtime. Don't have a pooling time to check anymore, now it's done with a heap.

0 comments on commit 1e1b66b

Please sign in to comment.