CacheConfig class

Configuration for the HTTP cache

Constructors

CacheConfig({int maxMemorySize = 10 * 1024 * 1024, int maxMemoryEntries = 100, int maxDiskSize = 50 * 1024 * 1024, int maxDiskEntries = 1000, CacheType cacheType = CacheType.private, EvictionStrategy evictionStrategy = EvictionStrategy.lru, bool enableHeuristicFreshness = true, double heuristicFreshnessPercent = 0.10, Duration maxHeuristicFreshness = const Duration(days: 7), bool serveStaleOnError = true, Duration maxStaleAge = const Duration(days: 1), bool doubleKeyCache = false, String? databasePath, CacheStorage? customStorage, bool enableLogging = false, HttpClientType httpClientType = HttpClientType.defaultHttp})
const

Properties

cacheType CacheType
final
customStorage CacheStorage?
final
databasePath String?
final
doubleKeyCache bool
final
enableHeuristicFreshness bool
final
enableLogging bool
final
evictionStrategy EvictionStrategy
final
hashCode int
The hash code for this object.
no setterinherited
heuristicFreshnessPercent double
final
httpClientType HttpClientType
final
maxDiskEntries int
final
maxDiskSize int
final
maxHeuristicFreshness Duration
final
maxMemoryEntries int
final
maxMemorySize int
final
maxStaleAge Duration
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serveStaleOnError bool
final

Methods

copyWith({int? maxMemorySize, int? maxMemoryEntries, int? maxDiskSize, int? maxDiskEntries, CacheType? cacheType, EvictionStrategy? evictionStrategy, bool? enableHeuristicFreshness, double? heuristicFreshnessPercent, Duration? maxHeuristicFreshness, bool? serveStaleOnError, Duration? maxStaleAge, bool? doubleKeyCache, String? databasePath, CacheStorage? customStorage, bool? enableLogging, bool? useDio}) CacheConfig
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