CacheControlHeader class final

A class representing the HTTP Cache-Control header.

This class manages cache directives like no-cache, no-store, max-age, must-revalidate, etc. It supports parsing header values and generating the appropriate header string.

Constructors

CacheControlHeader({bool noCache = false, bool noStore = false, int? maxAge, int? staleWhileRevalidate, bool? publicCache, bool? privateCache, bool mustRevalidate = false, bool proxyRevalidate = false, int? sMaxAge, bool noTransform = false, bool onlyIfCached = false, int? staleIfError, int? maxStale, int? minFresh, bool immutable = false, bool mustUnderstand = false})
Constructs a CacheControlHeader instance with the specified directives.
CacheControlHeader.parse(Iterable<String> values)
Parses the Cache-Control header value and returns a CacheControlHeader instance.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
immutable bool
Indicates that the response is immutable.
final
maxAge int?
Specifies the maximum amount of time (in seconds) a resource is considered fresh.
final
maxStale int?
Specifies the maximum amount of time (in seconds) a stale resource can be used.
final
minFresh int?
Specifies the minimum amount of time (in seconds) a resource is considered fresh.
final
mustRevalidate bool
Specifies that the response must be revalidated with the origin server before use.
final
mustUnderstand bool
Indicates that the response must be understood by the cache.
final
noCache bool
Specifies that the response should not be cached.
final
noStore bool
Specifies that the cache should not store the response.
final
noTransform bool
Indicates that the response is allowed to be transformed by intermediaries.
final
onlyIfCached bool
Indicates that the response should only be returned from cache and not fetch from origin.
final
privateCache bool?
Specifies that the resource is only for private use (specific to a single user).
final
proxyRevalidate bool
Specifies that the shared cache must revalidate with the origin server before use.
final
publicCache bool?
Specifies whether the cache can be shared by different users (public caching).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sMaxAge int?
Specifies the maximum amount of time (in seconds) a resource is considered fresh for shared caches.
final
staleIfError int?
Specifies the maximum amount of time (in seconds) a stale resource can be used while the cache is being refreshed.
final
staleWhileRevalidate int?
Specifies the maximum amount of time (in seconds) a stale resource can be used.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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

Constants

codec → const HeaderCodec<CacheControlHeader>