CacheOptions class

Configuration options for caching responses in API calls.

Constructors

CacheOptions({String generateCacheKey(RequestOptions options, String key)?, bool useAuthorization = true, bool useSecureStorage = false, bool resetOnRestart = false, Duration cacheLifetimeDuration = const Duration(days: 10)})
Constructor to create a CacheOptions instance with specified settings.
const

Properties

cacheLifetimeDuration → Duration
The duration that defines how long the cache is valid.
final
generateCacheKey → String Function(RequestOptions options, String key)?
A function to override the default cache key structure.
final
hashCode → int
The hash code for this object.
no setterinherited
resetOnRestart → bool
Determines whether the cache should be reset upon application restart.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
useAuthorization → bool
Indicates if the authorization header (e.g., JWT) will be part of the cache key.
final
useSecureStorage → bool
Specifies whether to use secure storage for cached responses.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited