set method
Sets a value with the given key.
key must not be null.
value must not be null.
options can be provided to configure expiration.
Implementation
@override
Future<void> set(
String key,
Uint8List value, [
DistributedCacheEntryOptions? options,
]) async {
final entry = _cache.createEntry(key)..value = value;
if (options != null) {
entry
..absoluteExpiration = options.absoluteExpiration
..absoluteExpirationRelativeToNow =
options.absoluteExpirationRelativeToNow
..slidingExpiration = options.slidingExpiration;
}
// Commit the entry
if (entry is CacheEntryInternal) {
_cache.finalizeEntry(entry);
}
}