Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transfer-encoding: chunked vs content-length #5424

Closed
laurawu opened this issue Oct 20, 2014 · 1 comment
Closed

transfer-encoding: chunked vs content-length #5424

laurawu opened this issue Oct 20, 2014 · 1 comment

Comments

@laurawu
Copy link

laurawu commented Oct 20, 2014

#2719 implemented chunk loading, it requests the server to return response with content-length. while for tomcat apache server, which uses the http 1.1 and use transfrer-encoding in place of content-length.

Is there a special setting to support transfer-encoding "chunked"? or is there a other way to implement partial content loading for large pdf document?

@yurydelendik
Copy link
Contributor

PDF.js uses HTTP range requests to "ask" server for data need to display particular page. And it does not matter if transfer-encoding is used -- the received data is handled by browser's XHR so it shall not be an issue. However it is PDF.js must know the total length if the file to accurately estimate size of the document. If server does not support range requests, PDF.js will try to load data progressively, but that's currently supported by Firefox's XHR only (moz-chunked-arraybuffer responseType). See #5319 for details.

There are not many PDFs that are linearized (web optimized) -- non-linerized PDFs contain important data at the end of the file, so just using streaming/loading progressively will not help. Closing as answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants