TunnelCacheOptions class
The in-memory response cache of an HTTP tunnel (RFC 9111), held by the Hub.
In a request, a null size means "the Hub's per-tunnel default"; in the
Hub's reply (TunnelHandle / TunnelInfo) both sizes are the values the
Hub actually granted, after clamping to its limits.
- Annotations
-
- @immutable
Constructors
- TunnelCacheOptions({int? maxBytes, int? maxEntryBytes, bool cachePrivate = false, Duration? defaultTtl})
-
Creates cache options.
const
Properties
- cachePrivate → bool
-
Also cache
Cache-Control: privateresponses. They are then shared by every consumer of the tunnel; responses that set a cookie and requests that carryAuthorizationare still never cached.final - defaultTtl → Duration?
-
Freshness given to responses that state none (no
max-age/s-maxage/Expires).nullleaves them uncached.final - hashCode → int
-
The hash code for this object.
no setterinherited
- maxBytes → int?
-
The most bytes the tunnel's cache may hold (
null: the Hub's default).final - maxEntryBytes → int?
-
The largest single response stored (
null: 8 MiB); bigger ones are relayed but not kept.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
-
toJson(
) → Map< String, dynamic> - Encodes to JSON.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Map< String, dynamic> d) → TunnelCacheOptions - Decodes from JSON.
-
optFrom(
Map< String, dynamic> d, String key) → TunnelCacheOptions? -
Decodes the optional object at
key, ornull.
Constants
- defaultMaxEntryBytes → const int
- The default largest-entry size.