agecache icon indicating copy to clipboard operation
agecache copied to clipboard

Add support for expire after types: on-write, on-access

Open dferstay opened this issue 4 years ago • 1 comments

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]

dferstay avatar May 15 '20 18:05 dferstay

@calvinfo , @danielstjules , @rbranson , would you be able to take a look at this when you get a chance? :)

Cheers, -Daniel

dferstay avatar May 15 '20 20:05 dferstay