CachePolicy class

Cache policy controlling freshness and revalidation rules for routes.

Constructors

CachePolicy({Duration ttl = const Duration(minutes: 5), Duration? staleWhileRevalidate = const Duration(minutes: 15), Duration? staleIfError = const Duration(hours: 1), List<String> tags = const [], bool isCacheable = true})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
isCacheable → bool
Whether responses are allowed to be cached.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
staleIfError → Duration?
Extra window to serve stale content if origin provider fails.
final
staleWhileRevalidate → Duration?
Extra window to serve stale content while regenerating in background.
final
tags → List<String>
Semantic tags applied to entries generated with this policy.
final
ttl → Duration
Standard content cache policy.
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

Constants

noCache → const CachePolicy
Completely disables caching for this route.