agecache
agecache copied to clipboard
Add support for expire after types: on-write, on-access
This commit allows caches to be configured with an ExpireAfterType that controls how entries are expired from the cache; two types are supported.
- ExpireAfterWrite specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, or the most recent replacement of its value.
- ExpireAfterAccess specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last access.
ExpireAfterType defaults to ExpireAfterWrite for backwards-compatibility.
Signed-off-by: Daniel Ferstay [email protected]
@calvinfo , @danielstjules , @rbranson , would you be able to take a look at this when you get a chance? :)
Cheers, -Daniel