Expand description
Server advice and a session’s relative expiry, read leniently.
The server tunes clients it cannot redeploy through one X-Capsule-Advice header on session
create and HEAD: an RFC 9651 structured-field dictionary of integers whose members are
chunk (suggested chunk bytes), sessions (in-flight sessions per lane), ranges
(in-flight ranges per session) and ttl (seconds the advice holds) — networking design doc,
Server Advice. Advice is never an instruction, so reading it never fails:
- Clamped. Every member is clamped into bounds compiled into this client. A window member can only lower the client’s own cap: the effective window is the smaller of the two.
- Lenient. A member this client does not know is ignored, a member whose value is not an integer is treated as absent, and an absent member — or an absent or malformed header — is the client’s own default.
- Bounded in time. Advice older than its
ttlis dropped, exceptranges, which is fixed for the session’s life.
The session’s own expiry travels beside the advice as seconds remaining
(X-Capsule-Session-Expires-In, X-Capsule-Session-Idle-Expires-In), never as an instant,
so a skewed device clock still schedules correctly (SessionExpiry).
Structs§
- Server
Advice - What one
X-Capsule-Adviceheader said, already clamped into this client’s bounds. - Session
Expiry - A session’s remaining lifetime as the server stated it, relative to the response.
Constants§
- ADVICE_
HEADER - The advice header.
- DEFAULT_
ADVICE_ TTL - How long advice that names no usable
ttlholds. - EXPIRES_
IN_ HEADER - Seconds until the session’s lifetime cap.
- IDLE_
EXPIRES_ IN_ HEADER - Seconds until the session’s survival floor.
- MAX_
ADVICE_ LEN - A header longer than this is not read at all: advice is a handful of integers, and a header past this length is a server bug or a hostile one, either way the client’s defaults.
- MAX_
ADVICE_ TTL - The longest any advice holds, whatever its
ttlsays. - MAX_
ADVISED_ RANGES - The most in-flight ranges per session any advice can grant: the protocol’s ceiling on a session’s in-flight cap (transfer upload design doc, Bounded fan-in).
- MAX_
ADVISED_ SESSIONS - The most in-flight sessions per lane any advice can grant.