CacheConfig class
Configuration class for cache-related parameters
Constructors
- CacheConfig({required IwsCache cache, Duration? ttl, bool staleWhileRevalidate = false, bool forceRefresh = false})
-
const
- CacheConfig.forceRefresh({required IwsCache cache, Duration? ttl, bool staleWhileRevalidate = false})
-
Creates a cache config that forces refresh from server and updates cache
const
- CacheConfig.staleWhileRevalidate({required IwsCache cache, Duration? ttl, bool forceRefresh = false})
-
Creates a cache config with stale-while-revalidate enabled
const
- CacheConfig.standard({required IwsCache cache, Duration? ttl, bool forceRefresh = false})
-
Creates a cache config with stale-while-revalidate disabled (default behavior)
const
Properties
- cache → IwsCache
-
Cache instance to store and retrieve results
final
- forceRefresh → bool
-
If true, forces a fresh fetch from server and updates cache, ignoring existing cached data
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- staleWhileRevalidate → bool
-
If true, returns cached data immediately (if available) and updates cache in background
final
- ttl → Duration?
-
Time-to-live for cache entries (optional)
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