getCache method

  1. @override
Future<ResponseCache> getCache(
  1. String scenarioName,
  2. String iterationName, {
  3. CancellationToken? cancellationToken,
})
override

Returns a ResponseCache for responses associated with the given scenarioName and iterationName.

Implementation

@override
Future<ResponseCache> getCache(
  String scenarioName,
  String iterationName, {
  CancellationToken? cancellationToken,
}) async {
  _validateSegment(scenarioName, 'scenarioName');
  _validateSegment(iterationName, 'iterationName');
  final sep = Platform.pathSeparator;
  final cacheDir = '$_cacheRootPath$sep$scenarioName$sep$iterationName';
  return DiskBasedResponseCache(
    cacheDir,
    timeToLive: _timeToLive,
    clock: _clock,
  );
}