-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Chrome 39 seems to incorrectly cache RangeResponses #5512
Comments
it even reproduces locally on the tracemonky paper. |
@CodingFabian Could you paste the headers of an allegedly cached response? |
@Rob--W no need for a script. this is default behaviour of pdf.js here. Here the first request when working
and here when not:
so from what it looks like there is already something odd when the very first request is visible in the console. |
@CodingFabian I had some time to bisect:
Which kinda points to https://chromium.googlesource.com/chromium/src.git/+/439a05cd87fe1f880b896bd7b154454299355899%5E%21/ |
yeah good find. though quite annoying, because pdf.js should then disable ranges for confirmed chrome versions (39?) (similar to the safari disable) |
Yes, we should, until the issue will be sorted out, at least for versions 39-41. PR is welcome. STR in the chromium issue shall be corrected as well. |
Ok, will do that. |
while i was waiting for a clearer confirmation from chrom(e|ium), I think its safe to assume we should disable range requests for chrome > 39. |
@CodingFabian Wouldn't it be better to detect response code 206 and handle that appropriately instead of disabling range requests all together? |
that would be better and quite complicated. for safari and android we already disable it globally because the quirks are complicated to detect. |
Disabling Range Support for Chrome 39 and above, due to regression in Chromium. Will be enabled once a fix version is confirmed. * https://code.google.com/p/chromium/issues/detail?id=444659 * https://code.google.com/p/chromium/issues/detail?id=442318
Disabling range requests has implications for perceived performance, especially for huge documents and/or slow connections. That's why I'm opposed to disabling range requests unless there is no alternative. The first request is only used to get the file's metadata, and if range requests are supported, the request is aborted. However, due to the fact that Chrome 39+ replies with status 206 instead of 200, PDF.js bails out and reports an error. Since the metadata is available (range requests is supported as implied by status code 206, and also content-length), I think that it is feasible to reliably detect this bug and treat it appropriately (e.g. continue fetching ranges). |
feel free to make a PR. MY PR does a nicely coupled clean hotfix in compatibility.js, which at least makes pdf.js work again :) |
Use Content-Range header instead of Content-Length when the response has status code 206, to work around issue mozilla#5512, which is caused by a bug in Chrome (since version 39): https://code.google.com/p/chromium/issues/detail?id=442318
@CodingFabian See PR #5603. |
Use Content-Range header instead of Content-Length when the response has status code 206, to work around issue mozilla#5512, which is caused by a bug in Chrome (since version 39): https://code.google.com/p/chromium/issues/detail?id=442318
Use Content-Range header instead of Content-Length when the response has status code 206, to work around issue mozilla#5512, which is caused by a bug in Chrome (since version 39): https://code.google.com/p/chromium/issues/detail?id=442318
Use Content-Range instead of Content-Length #5512
* 'master' of https://github.com/mozilla/pdf.js: (88 commits) Amend the docs for |disableAutoFetch| to mention that streaming must also be disabled Chrome extension: Add options page Prevent setting |isStandardFont| to |undefined| for non-embedded fonts Attempt to display the File size quicker in the Document Properties dialog (PR 5554 followup) Fix thumbnail scaling regression for files with different page sizes (issue 5637) Base64 example and be more flexible what type of data is passed. Add marker segment (PLT, PLM) and refactor TLM Refactor searching for end of inline (EI) JPEG image streams Modify |getUint16| to correctly handle missing data in Stream, DecodeStream and ChunkedStream Fixes B2G file open sequence. Whitelists 'tel' schema. Fix lint error: "test/webserver.js: line 177, col 106, Line is too long." Adds encoding for test server index page. Move the |pagerendered| event to pdf_page_view.js Add a |textlayerrendered| event Version 1.0.1040 Use Content-Range instead of Content-Length mozilla#5512 Refactors getDocument and adds PDFDataRangeTransport. Add missing comma to German add-on description Implement guards for stringToBytes and bytesToString ...
Use Content-Range header instead of Content-Length when the response has status code 206, to work around issue mozilla#5512, which is caused by a bug in Chrome (since version 39): https://code.google.com/p/chromium/issues/detail?id=442318
Use Content-Range instead of Content-Length mozilla#5512
Disabling Range Support for Chrome 39 and 40, due to regression in Chromium. https://crbug.com/442318
Disable Range Support for Chrome 39+40 (#5512)
Fixed by #5598. |
* 'master' of https://github.com/mozilla/pdf.js: (51 commits) Revert mozilla#5603 regarding Chrome range request bug Disable Range Support for Chrome 39+40 (mozilla#5512) Prevent Firefox from warning about |unreachable code after return statement| Simplify document properties field logic Enable linting of Firefox specific code in viewer.js Group public/private methods and add comments Clarify bug reporting with regards to providing a pdf Add a reduced test-case for issue 5801 Attempt to infer if a CMap file actually contains just a standard `Identity-H`/`Identity-V` map Refactor PDFDocumentProperties to be more class-like Rename DocumentProperties to PDFDocumentProperties Remove no longer needed hacks that enable spacebar scrolling in Firefox (issue 3498) Preface all "fullscreen" CSS rules with a |pdfPresentationMode| class, and add it to the |viewerContainer| while Presentation Mode is active Refactor PDFPresentationMode to be more class-like Re-ordering the PDFPresentationMode code so that the "public" functions are placed towards the top of the file Initial refactoring of the PDFPresentationMode code Rename the presentation_mode.js file and adjust the function names Refactor the options passed to |PresentationMode.initialize| and clean-up some code in viewer.js and presentation_mode.js Move the PresentationMode-specific scrollWheel code from PDFViewerApplication Break dependencies between PresentationMode and other code, and add PresentationMode related utility methods to PDFViewer ...
Message: Unexpected server response (206) while retrieving PDF.
It looks like either PDF.js does something strange, or there is a regression in Chrome 39 (Version 39.0.2171.65 (64-bit)).
Sometimes I am getting a partial response for the first request. If I have dev-tools with the cache override open, this does not happen at all.
If I allow caching then chrome seems to mix up the responses sometimes.
Might be a regression of the streaming implementation?
Right now I need to add Chrome 39 to checkRangeRequests() in Compatibility.js
The text was updated successfully, but these errors were encountered: