cache_store 0.5.7 cache_store: ^0.5.7 copied to clipboard
A Dart store for caching instances to various backends (memory, file, ...).
cache_store #
A Dart store for caching instances to various backends (memory, file, ...).
Quickstart #
Future<Cache<int>> update(String key) async {
await Future.delayed(const Duration(seconds: 2));
return Cache.fromNow(
key: key,
value: 42,
expiresIn: const Duration(seconds: 1),
);
}
final store = MemoryCacheStore<int>();
var entry = await store.get("test", ifExpired: update);