DioCacheOptions class

Constructors

DioCacheOptions({Duration? maxAge, List<int> hitCacheOnErrorExcept = const <int>[401, 403], CacheKeyBuilder keyBuilder = defaultCacheKeyBuilder, Duration maxStale = const Duration(days: 7), CachePriority priority = CachePriority.normal, bool allowPostMethod = false, CachePolicy cachePolicy = CachePolicy.request})
DioCacheOptions.noCache()

Properties

allowPostMethod bool
allow POST method request to be cached.
finalinherited
cipher → CacheCipher?
Optional method to decrypt/encrypt cache content
finalinherited
hashCode int
The hash code for this object.
no setterinherited
hitCacheOnErrorExcept List<int>?
Ability to return cache excepted on given status codes. Giving an empty list will hit cache on any status codes.
finalinherited
keyBuilder → CacheKeyBuilder
Builds the unique key used for indexing a request in cache. Default to CacheOptions.defaultCacheKeyBuilder
finalinherited
maxAge Duration?
final
maxStale Duration?
Overrides any HTTP directive to delete entry past this duration.
finalinherited
policy → CachePolicy
Handles behaviour to request backend.
finalinherited
priority → CachePriority
The priority of a cached value. Ease the clean up if needed.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store → CacheStore?
Store used for caching data.
finalinherited

Methods

copyWith({CachePolicy? policy, Nullable<List<int>>? hitCacheOnErrorExcept, CacheKeyBuilder? keyBuilder, Nullable<Duration>? maxStale, CachePriority? priority, CacheStore? store, Nullable<CacheCipher>? cipher, bool? allowPostMethod}) → CacheOptions
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toExtra() Map<String, dynamic>
inherited
toOptions() Options
inherited
toString() String
A string representation of this object.
inherited

Operators

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