• Forum
  • Lounge
  • General - Partial request and maintainin

 
General - Partial request and maintaining connection


I’ve setup a partial response for a partial request. When a big file is requested I’m returning e.g > 100000 bytes back each time. This forces the browser to continue sending requests for the remaining bytes, which is the plan. Now, these following requests only comes if the player has reached that certain point (the browser is detecting this) which is also good.


The problem is that the browser doesn’t maintain the current connection, because the content-length and content-range of e.g 100000 is already received. I guess I can set the content-length and content-range to the end of the file, then continue to send in intervals until the full range is received. However, this way the browser doesn’t let me know if the user has reached that point in the player, it would just be a random process.


So is there a way to maintain that connection and receive new requests only if the user has reached that point in the player?


Best regards
Volang
When a big file is requested I’m returning e.g > 100000 bytes back each time. This forces the browser to continue sending requests for the remaining bytes
You're doing this over HTTP(S)?

The problem is that the browser doesn’t maintain the current connection, because the content-length and content-range of e.g 100000 is already received.
I don't know what you're doing, but it sounds like you're using the wrong protocol.

If you want the client to asynchronously recieve data from the web server, you probably set up a Web Socket connection for that.
Topic archived. No new replies allowed.