VadimDez/ng2-pdf-viewer

Range requests / partial responses do not work in chrome

dvanadrichem-evs opened this issue · 0 comments

Bug Report or Feature Request (mark with an x)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request

Summary

I am trying to render a fairly large PDF of tens of megabytes and I expect the file to be fetched in chunks using HTTP Range requests. PDF.js does support this, but it looks like this feature is not working in ng2-pdf-viewer.

Repro

Open up a chrome based browser (I tried edge and vivaldi both on Chrome/124.0.0.0).

Go to https://vadimdez.github.io/ng2-pdf-viewer/ and turn off "show all pages", open network tab and then paste a link to a fairly large PDF in the URL box on to top left hand side of the page.

Actual behaviour: Observe in the network tab that a single request is done to fetch the PDF file, the response status code is 200:

image

Expected behaviour: multiple requests to the PDF resource are done, each with response code 206 partial request.

It works correctly in FireFox, the actual behaviour in FireFox 125.0.3 is the same as expected behaviour:

image

Notes

I am a new user of this project, but this issue appears might be a regression because I have seen multiple issues that talked about range requests working properly, but something else not working. So I deduce that at that time, range requests did work.

Unfortunately I don't have access to older versions of chrome, to test of that has any influence.

Question

Any help, comments, feedback on how to troubleshoot or investigate a fix is greatly appreciated.