CacheTtl class final

Time-to-live configuration attached to a cache entry.

Constructors

CacheTtl(Duration duration)
const
CacheTtl.hours(int hours)
CacheTtl.minutes(int minutes)

Properties

duration Duration
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

isExpired(DateTime createdAt) bool
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

cart → const CacheTtl
Shorter TTL for cart and pricing (30 seconds).
defaultProducts → const CacheTtl
Sensible default for product/collection data (5 minutes).
infinite → const CacheTtl
Never expire (useful for immutable resources like product IDs).