abstract-blob-store
abstract-blob-store copied to clipboard
support range requests
would be useful if blob stores could optionally support this
I propose:
store.createReadStream({
key: ...,
start: inclusiveStart,
end: inclusiveEnd
})
sounds good
Do we need a manifest like thing that announces which features you support (besides read/write streams)?
store.manifest = {ranges:true}
@mafintosh yea thats probably a good idea as well. destroy/remove could be in the manifest too
Any update on this?
@olalonde not yet, but soon we're gonna be doing a blob heavy project so there will probably be some movement then
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) {
}
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
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