abstract-blob-store icon indicating copy to clipboard operation
abstract-blob-store copied to clipboard

support range requests

Open max-mapper opened this issue 11 years ago • 9 comments

would be useful if blob stores could optionally support this

max-mapper avatar Aug 29 '14 19:08 max-mapper

I propose:

store.createReadStream({
  key: ...,
  start: inclusiveStart,
  end: inclusiveEnd
})

mafintosh avatar Oct 17 '14 02:10 mafintosh

sounds good

max-mapper avatar Oct 17 '14 02:10 max-mapper

Do we need a manifest like thing that announces which features you support (besides read/write streams)?

store.manifest = {ranges:true}

mafintosh avatar Oct 17 '14 02:10 mafintosh

@mafintosh yea thats probably a good idea as well. destroy/remove could be in the manifest too

max-mapper avatar Oct 17 '14 02:10 max-mapper

Any update on this?

olalonde avatar Oct 20 '15 06:10 olalonde

@olalonde not yet, but soon we're gonna be doing a blob heavy project so there will probably be some movement then

max-mapper avatar Oct 20 '15 16:10 max-mapper

we are revisiting this now, and think a low level optional API for random access would be nice (in addition to the existing higher level stream API)

module.exports.read = function read (key, offset, length, cb) {

}

module.exports.write = function write (key, offset, buffer, cb) {

}

max-mapper avatar Dec 22 '15 22:12 max-mapper

Any status update on this? I propose we start with an optional range key in the createReadStream opts object: { range: { start, end } }

I started using abstract-blob-store to serve static files from an express server a while ago but now absolutely need range requests to serve HTML5 video files.

Example implementation for s3-blob-store: https://github.com/olalonde/s3-blob-store/blob/range-requests/index.js#L20

olalonde avatar Sep 01 '16 23:09 olalonde

Hrm, you kind of need the total size for http

Content-Range: bytes 200-1000/67589 https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range

It says you can use a * if you don't know, but at least one of the browsers gets fussy if you try to do that with streaming media

laduke avatar Nov 22 '19 05:11 laduke