Skip to content

httpRangeSource

httpRangeSource(url, options?): Promise<RangeSource>

A RangeSource over a URL, for Document.openRange. The first request asks for the last tail bytes, which gives the size and the part of the file a reader needs first (the xref is at the end). Every later request sends If-Range with the first strong ETag (else its Last-Modified); a response whose ETag, Last-Modified or total size differs fails with source-changed. A server that ignores Range (it answers 200) is read with that one full download.

The server must allow Range (across origins: Access-Control-Allow-Headers: Range and Access-Control-Expose-Headers: Content-Range, Content-Length, ETag) and must not compress the response.

string | URL

the file.

HttpRangeOptions = {}

headers, credentials, signal, block size.

Promise<RangeSource>

the source, once the first request has answered.

LaminaError fetch-failed (with data.status), source-changed.