hints / network
ECT
ECT summarizes measured network quality into four buckets (slow-2g, 2g, 3g, 4g), making it the most usable of the network client hints.
- Example
ECT: 4g- JavaScript
navigator.connection.effectiveType- Available since
- Chrome 67 (2018)
- Engines
- Chrome Edge Opera Firefox Safari
- References
- MDN · Specification
ECT (Effective Connection Type) compresses the browser’s live network measurements into one of four labels:
Accept-CH: ECT
ECT: 4g # also: 3g, 2g, slow-2g “Effective” is the operative word
The value is not read from the modem. The browser continuously measures round-trip times and throughput, then reports which cellular generation the connection currently behaves like. Fiber behind a congested VPN can report 3g; modern 5G reports 4g because the scale was frozen in 2018 and 4g simply means “fast enough that speed isn’t the constraint”. Read the four values as: unusable / very slow / workable / fine.
Server-side use
Of the three measured network hints, ECT is the one with sensible cardinality for real decisions. Four values map cleanly onto experience tiers and cache variants:
slow-2g/2g→ text-first: no images above the fold, no video, system fonts.3g→ compressed images, defer heavy embeds.4g→ normal experience.
Vary: ECT Four cache variants is manageable; per-millisecond RTT values are not. If you act on one measured network signal, make it this one, and treat Save-Data as an override in whatever bucket you land.
In JavaScript
navigator.connection?.effectiveType // "4g"
navigator.connection?.addEventListener('change', reassess); The change event matters: someone walks from Wi-Fi into a stairwell mid-session, and the header you saw at request time is stale. Header for the initial payload, JS listener for the session.
Chromium-only, and MDN marks the whole Network Information family experimental. It has shipped and been stable in practice since 2018, but with no Firefox or Safari support, so always default to the full experience when the header is absent.