CacheOptions constructor

const CacheOptions({
  1. String generateCacheKey(
    1. RequestOptions options,
    2. String key
    )?,
  2. bool useAuthorization = true,
  3. bool useSecureStorage = false,
  4. bool resetOnRestart = false,
  5. Duration cacheLifetimeDuration = const Duration(days: 10),
})

Constructor to create a CacheOptions instance with specified settings.

Implementation

const CacheOptions({
  this.generateCacheKey,
  this.useAuthorization =
      true, // Default is true; JWT is included in cache key.
  this.useSecureStorage =
      false, // Default is false; responses are not stored securely by default.
  this.resetOnRestart =
      false, // Default is false; cache won't reset on restart.
  this.cacheLifetimeDuration =
      const Duration(days: 10), // Default cache lifetime is 10 days.
});