Accept-Ranges
The HTTP Accept-Ranges response header indicates the server supports partial requests for the resource.
Usage
The Accept-Ranges header tells clients the server accepts Range requests, enabling partial downloads of a resource. This is essential for resuming interrupted file transfers, streaming media from a specific position, and fetching segments of large files on demand.
When a client sends a Range request, the server returns a 206 Partial Content response containing only the requested byte segment. The Content-Range response header specifies the exact byte range and total size of the resource.
If the requested range is invalid or falls outside the resource boundaries, the server responds with 416 Range Not Satisfiable.
Directives
bytes
The server accepts byte-range requests. This is the only range unit defined by HTTP and the most common value for the header.
none
The server does not support range requests for this
resource. Sending none explicitly advises clients not
to attempt range requests.
Example
A server indicating support for byte-range requests. Download managers and media players use this signal to request specific portions of a file.
Accept-Ranges: bytes
A server explicitly disabling range requests. Clients receiving this value download the full resource in a single request.
Accept-Ranges: none
A typical response for a downloadable file, combining the range support indicator with the content length. A client interrupted at byte 5000 resumes from the point of failure.
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 1048576
Content-Type: application/octet-stream
Takeaway
The Accept-Ranges response header signals support for partial downloads through Range requests, enabling clients to resume transfers and fetch specific byte segments of a resource.