set method

Future<void> set(
  1. String key,
  2. Object? value, {
  3. Duration? ttl,
  4. List<String> tags = const <String>[],
})

Stores value under key.

With a ttl the entry expires after it; without one it stays until it is deleted or evicted. tags name groups that deleting a DVCacheTag drops.

Implementation

Future<void> set(
  String key,
  Object? value, {
  Duration? ttl,
  List<String> tags = const <String>[],
}) async {
  final String scoped = _scoped(key);
  await _store.write(scoped, value, ttl);
  if (tags.isNotEmpty) _tags.tag(scoped, tags);
}