tags:

views:

28

answers:

1

OK, I know this is a long shot:

Does HTTP offer a way to stream a file out of order? I'm dealing with a binary file format which can almost be streamed, except the header requires some summary data, and it would be a much better user experience if I could stream it.

It seems like it would be really great to be able to send the last part of a file first, then the header, like BitTorrent &co, but it also seems obscure enough that I'm not optimistic.

Thanks!

A: 

You could do a HEAD request to get the content length and then do range requests - I don't think you can just stream out of order though. You may be able to get away without using a HEAD request as well. Take a look at Content-range.

SB
That's a good idea, and I think it would work if I controlled both the server and the client. But in this case I want to do out-of-order streaming to ordinary web browsers, and it doesn't look like there's a way for a server to say "please ask for the end first, since I can deliver that more quickly", and there's no way for a client to guess that that's the case. Oh well.
Ken