Search code examples
javascriptgetxmlhttprequestchunked

xhttpRequest Get Range of Chunked Response?


I am using Javascript to request a large text file (>16 MB) from a URL and update it with periodic new additions to the text file

I have a GET request to a URL that returns a response with the header "Transfer-Encoding: chunked" and I am wondering if it is possible to request only a range of that file to avoid repeatedly requesting the whole file.

I tried using the Range header in the request but the whole file is still sent from the server.


Solution

  • I found this solution by The BalusC Code that I was able to adapt in the jsp portion of the servlet file I'm working on to handle range-requests.