#cache #ttl #expire

izihawa_ttl_cache

A cache that will expire values after a TTL

1 unstable release

0.5.1 Sep 29, 2023

#14 in #expire


Used in 2 crates (via summa-core)

MIT/Apache

23KB
330 lines

ttl_cache

Actions Status Documentation

This crate provides a time sensitive key-value FIFO cache. When the cache is created it is given a TTL. Any value that are in the cache for longer than this duration are considered invalid and will not be returned. Supports 1.20 +


lib.rs:

This crate provides a time sensitive key-value cache. When an item is inserted it is given a TTL. Any value that are in the cache after their duration are considered invalid and will not be returned on lookups. Entries are not removed from the cache on expiration. Instead the expired values are removed opportunistically as they are reference or if remove_expired is explicitly called.

Dependencies

~0–1.5MB
~29K SLoC