Accept-Ranges

The Accept-Ranges response HTTP header is a marker used by the server to advertise its support of partial requests. The value of this field indicates the unit that can be used to define a range.

服务器使用 HTTP 响应头 Accept-Range 标识自身支持范围请求。字段值用于定义范围请求的单位。

In presence of an Accept-Ranges header, the browser may try to resume an interrupted download, rather than to start it from the start again.

当浏览器发现 Accept-Range 头时,可以尝试继续中断了的下载,而不是重新开始。

Header type Response header
Forbidden header name no

语法

Accept-Ranges: bytes
Accept-Ranges: none

指令

none
No range unit is supported, this makes the header equivalent of its own absence and is therefore rarely used, though some browsers, like IE9, it is used to disable or remove the pause buttons in the download manager.
不支持任何范围请求单位。
bytes

The unit for ranges are bytes.

范围请求的单位是 bytes (字节)。

示例

Accept-Ranges: bytes

规范

Specification Title
RFC 7233, section 2.3: Accept-Ranges Hypertext Transfer Protocol (HTTP/1.1): Range Requests

浏览器兼容性

No compatibility data found. Please contribute data for "http/headers/accept-ranges" to the MDN compatibility data repository.

参见

文档标签和贡献者