大网数据广告活动
Web 标准与前端开发

RTT header

· 52CE 我爱测

The HTTP **`RTT`** request header is a network client hint which provides the approximate round trip time on the application layer, in milliseconds. The RTT hint includes server processing time, unlike transport layer RTT.

The HTTP RTT request header is a network client hint which provides the approximate round trip time on the application layer, in milliseconds. The RTT hint includes server processing time, unlike transport layer RTT.

The RTT value is rounded to the nearest 25 milliseconds to prevent fingerprinting, although there are many other mechanisms an attacker might use to obtain similar round-trip information.

The hint allows a server to choose what information is sent based on the network responsiveness/latency. For example, it might choose to send fewer resources.

[!NOTE] The Vary header is used in responses to indicate that a different resource is sent for every different value of the header (see HTTP Caching Vary). Even if RTT is used to configure what resources are sent consider omitting it in the Vary header — it is likely to change often, which effectively makes the resource uncacheable.

<table class="properties"> <tbody> <tr> <th scope="row">Header type</th> <td> Request header, <a href="/en-US/docs/Web/HTTP/Guides/Client_hints">Client hint</a> </td> </tr> <tr> <th scope="row">Forbidden request header</th> <td>No</td> </tr> </tbody> </table>

Syntax

RTT: <number>

Directives

  • <number>
    • : The approximate round trip time in milliseconds, rounded to the nearest 25 milliseconds.

Examples

Using RTT client hints

A server first needs to opt in to receive the RTT header by sending the Accept-CH response header containing RTT.

Accept-CH: RTT

Then on subsequent requests the client might send an RTT header back:

RTT: 125

Specifications

Browser compatibility

See also

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。