set method

Future<void> set(
  1. String key,
  2. T data, {
  3. Duration? ttl,
})

Set cached data (writes to both memory and disk)

Implementation

Future<void> set(String key, T data, {Duration? ttl}) async {
  memoryCache.set(key, data, ttl: ttl);

  if (diskCache != null) {
    await diskCache!.set(key, data, ttl: ttl);
  }
}