DiskBasedResponseCacheProvider constructor

DiskBasedResponseCacheProvider(
  1. String storageRootPath, {
  2. Duration timeToLive = const Duration(days: 14),
  3. DateTime clock()?,
})

Creates a DiskBasedResponseCacheProvider rooted at storageRootPath.

timeToLive controls how long cached responses remain valid; defaults to 14 days.

Implementation

DiskBasedResponseCacheProvider(
  String storageRootPath, {
  Duration timeToLive = const Duration(days: 14),
  DateTime Function()? clock,
})  : _storageRootPath = Directory(storageRootPath).absolute.path,
      _timeToLive = timeToLive,
      _clock = clock;