HTTP Headers
RTT
Experimental: This is an experimental technology
Review the Browser compatibility table carefully before implementing this in production.
The HTTP RTT
request header is a network client hint that provides an estimate of the round-trip time on the application layer, measured in milliseconds.
The RTT hint considers server processing time, which differentiates it from transport layer RTT.
The RTT value is rounded to the nearest 25 milliseconds to reduce the risk of fingerprinting. However, there are numerous other mechanisms an attacker might employ to gather similar round-trip information.
This hint enables a server to decide what information to send based on network responsiveness or latency. For instance, it may opt to send fewer resources for slower connections.
Note:
The Vary
header in responses indicates that different resources are served for each distinct value of the header (see HTTP Caching Vary). Even if RTT
is used to determine resource selection, it’s advisable to consider omitting it from the Vary
header—allotting that it might change frequently—thus preventing the resource from becoming effectively uncacheable.
Header type | Request header, Client hint |
---|---|
Forbidden request header | No |
Syntax
The syntax for indicating the Round-Trip Time (RTT) in networking is represented by an explicit numeric value. This value specifies the duration it takes for a signal to travel from the source to the destination and back, typically measured in milliseconds.
Directives
The approximate round trip time in milliseconds, rounded to the nearest 25 milliseconds.
Example
Using RTT Client Hints
A server must first signal its ability to receive the RTT
header by including an Accept-CH response header that specifies RTT
.
Accept-CH: RTT
Subsequent requests from the client may then include the RTT
header to provide round-trip time measurements:
RTT: 125
How to Modify Header using Requestly
- Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
- Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
- Add a new header modification:
- Under “Action”, select “Add” or “Override”.
- In the “Header Name” field, enter RTT.
- In the “Header Value” field, enter the desired value to simulate a round-trip time (e.g., 150ms).
- Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
- Save the rule.
Modifying the RTT header helps you simulate different network delays so you can see how your application handles slower or faster connections. This is useful for improving user experience and troubleshooting performance issues.
Table of Contents
- No headings found.