ECT HTTP Header: Syntax, Directive, Examples

The ECT HTTP Header Client hint request header field indicates the effective connection type: slow-2g, 2g, 3g, 4g. Based on the time between the browser requesting a page and the effective type of the connection, effective connection type (ECT) refers to the measured network performance, returning a cellular connection type, such as 3G, even if the actual connection is tethered broadband or WiFi. There is only one value using the ECT HTTP Header. The value using the ECT HTTP Header is the “value”. An example of an ECT HTTP Header is written below. 

Accept-CH: ECT
ECT: 4g

The ECT HTTP Header Request Header can be seen above. In this article, the ECT HTTP Header Syntax, Directives and Uses examples will be processed. 

What is ECT HTTP Header?

The ECT HTTP Header hint request header field shows the effective connection type, which is one of the following: slow-2g, 2g, 3g, or 4g (fourth generation).

What is the Syntax of the ECT HTTP Header?

The ECT HTTP Header has only one value in its syntax. The syntax using the ECT HTTP Header is written below. 

ECT: <value>

What is the Directive of ECT HTTP Header?

The ECT HTTP Header can only contain one directive. The value reflects the sort of connection that is effective. This is one of the following options: slow-2g, 2g, 3g, or 4g. An example directive for using the From HTTP Header is given below. 

ECT: 3g
ECT: slow-2g
ECT: 3g
ECT: 4g

How to use ECT HTTP Header?

Fast-2g, 2g, 3g, and 4g are all indicated by the ECT HTTP Header Client hint request header field in the request header of the request. The value represents the “network profile” that best matches the latency and bandwidth of the connection, rather than the actual mechanisms that were utilized to move the data over the network. For example, 2g may be used to represent a slow wifi connection with high latency and low bandwidth, whereas 4g could be used to represent a fast fiber-based broadband network with high latency and high bandwidth. When a server receives a hint, it can pick which information to provide to a client depending on the general characteristics of the network. Examples include sending reduced copies of photos and other resources via less competent connections. Also possible is to utilize the value as a starting point for identifying what information should be delivered, which can then be refined further using information contained in the RTT and Downlink hints.

Examples of ECT HTTP Header Use

The following is an example of how to use the ECT HTTP Header. 

For instance, if a server wishes to accept the ECT HTTP Header, it must first opt-in by delivering the Accept-CH response header containing ECT HTTP Header.

Accept-CH: ECT

The client may then return an ECT HTTP Header on subsequent requests.

ECT: 3g

What are the Specification Documents for ECT HTTP Header?

There is only one specification document for the ECT HTTP Header which is the Network Information API> The Network Information API article discusses the ECT HTTP Header and its applications. Additionally, this page discusses the ECT HTTP Header’s definition and usage.

What are the types of ECT HTTP Header?

There are multiple types of ECT HTTP Header. The following HTTP Types are listed below.

  1. The ECT HTTP Header Client hint is a request header that specifies the connection type that is currently in use.
  2. The ECT HTTP Header Client Hint is an extra response header that contains information about the response, such as its location or the server that provided it.

What are the similar HTTP Headers to the ECT HTTP Header?

There are other similar HTTP to the ECT HTTP Header. The examples are listed below. 

  • Downlink HTTP Header: The Downlink HTTP Header Client hint request-header field contains the approximate bandwidth of the client’s connection to the server, expressed in megabits per second (Mbps). Similar to the ECT HTTP Header, another request header type. 
  • RTT HTTP Header: Similar to the ECT HTTP Header, which is likewise a request header type. The RTT HTTP Header Client Hints returns the application layer’s approximate round trip time in milliseconds. Unlike transmission layer RTT, the RTT hint includes server processing time.
  • Save-Data HTTP Header: Similar to the ECT HTTP Header, the RTT Client hint request header field is a request header type. The RTT Client Hints property returns the approximate round trip time, in milliseconds, at the application layer. In contrast to transport layer RTT, the RTT hint includes server processing time. 
  • Accept-CH HTTP Header: A server may set the Accept-CH HTTP Header to indicate which client hints headers a client should include in subsequent requests. As with the ECT HTTP Header, which is likewise set by the server.
  • NetworkInformation.effectiveType: The NetworkInformation interface’s read-only effective type property returns the connection’s effective type, which is one of slow-2g’, ‘2g’, ‘3g’, or ‘4g’. As with the ECT HTTP Header, this field indicates the effective connection type: slow-2g, 2g, 3g, or 4g.

Which Browsers Support ECT HTTP Header? 

There are multiple browsers that support ECT HTTP Header. The following browsers are listed below.

  • Chrome Browser is compatible with the ECT HTTP Header.
  • Edge Browser is compatible with the ECT HTTP Header.
  • Opera Browser is compatible with the ECT HTTP Header.
  • WebView Android Browser is compatible with the ECT HTTP Header.
  • Chrome Android Browser is compatible with the ECT HTTP Header.
  • Opera Android Browser is compatible with the ECT HTTP Header.
  • Samsung Internet Browser is compatible with the ECT HTTP Header.

You can see an image that shows cross-browsers compatibility of ECT HTTP Headers below.

ECT HTTP Header
Holistic SEO
Follow SEO

Leave a Comment

ECT HTTP Header: Syntax, Directive, Examples

by Holistic SEO time to read: 4 min
0