CacheControl class

Cache-Control header subset representation

Constructors

CacheControl({int maxAge = -1, String? privacy, int maxStale = -1, int minFresh = -1, bool mustRevalidate = false, bool noCache = false, bool noStore = false, List<String> other = const []})
CacheControl.fromHeader(List<String>? headerValues)
Builds Cache Control from header values
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
maxAge int
How long the response can be used from the time it was requested (in seconds). https://datatracker.ietf.org/doc/html/rfc7234#section-5.2.2.8
final
maxStale int
The "max-stale" request directive indicates that the client is willing to accept a response that has exceeded its freshness lifetime. https://datatracker.ietf.org/doc/html/rfc7234#section-5.2.1.2
final
minFresh int
The "min-fresh" request directive indicates that the client is willing to accept a response whose freshness lifetime is no less than its current age. https://datatracker.ietf.org/doc/html/rfc7234#section-5.2.1.3
final
mustRevalidate bool
The "must-revalidate" response directive indicates that once it has become stale, a cache MUST NOT use the response to satisfy subsequent requests without successful validation on the origin server. https://datatracker.ietf.org/doc/html/rfc7234#section-5.2.2.1
final
noCache bool
Must first submit a validation request to an origin server. https://datatracker.ietf.org/doc/html/rfc7234#section-5.2.2.2
final
noStore bool
Disallow cache, overriding any other directives (Etag, Last-Modified) https://datatracker.ietf.org/doc/html/rfc7234#section-5.2.2.3
final
other List<String>
Other attributes not parsed
final
privacy String?
'public' / 'private'. https://datatracker.ietf.org/doc/html/rfc7234#section-5.2.2.5
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toHeader() String
Serialize cache-control values
toString() String
A string representation of this object.
inherited

Operators

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