set method
Caches the response data from a request.
Implementation
Future<void> set(Response response, [Duration? cacheLifetimeDuration]) async {
final cacheKey = _generateCacheKey(response.requestOptions);
final cacheModel = CacheModel(
expirationDateTime: DateTime.now().add(
cacheLifetimeDuration ?? cacheOptions.cacheLifetimeDuration,
),
value: response.data,
);
await _storage.set(cacheKey, cacheModel.toMap());
}