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

Don't make two requests to download PDF #1907

Closed
jviereck opened this issue Jul 18, 2012 · 5 comments
Closed

Don't make two requests to download PDF #1907

jviereck opened this issue Jul 18, 2012 · 5 comments

Comments

@jviereck
Copy link
Contributor

When we open a PDF, we make currently two requests to the server. You can easily see this when opening the web inspector tools. There are two GET requests to the PDF domain.

In most cases this is no problem, however sometimes the server allows to download the PDF only once. Then, when the second request happens, the PDF is no longer served and therefore the PDF is not loadable in PDF.JS.

@brendandahl
Copy link
Contributor

This is expected. We cancel the original request in the extension and re-request in our code. Have you actually run into a pdf that is only downloadable once? I know it's possible (or the pdf served could be different on the second request) but I have yet to hear of anyone actually run into this.

@jviereck
Copy link
Contributor Author

This is expected. We cancel the original request in the extension and re-request in our code. Have you actually run into a pdf that is only downloadable once? I know it's possible (or the pdf served could be different on the second request) but I have yet to hear of anyone actually run into this.

Yes, someone reached me in Berlin. Basically, the user have to pay to view the PDFs. That's why it's really only possible to request the PDF once.

Why don't we listen to the data coming in the first time?

@pelinquin
Copy link

I am facing the same issue. (see https://bugzilla.mozilla.org/show_bug.cgi?id=782217).
In my application, each GET request for a PDF starts an heavy task (run Python script with parser, dot, pdflatex,...) so I really don't want to run that twice.
AcrobatReader is able to render the PDF with only one request and the embedded Chromium PDF viewer also works well, so I don't see any reason to make it so with FF.

@yurydelendik
Copy link
Contributor

Fixed by #1943

@jonny64
Copy link

jonny64 commented Nov 6, 2014

still two requests in IE11 (pdf.js build 1.0.917 deeaee9 and 1.0.940 45ca953)
it was ok on pdf.js bd11111 03.04.2014
what can I do to prevent this? we have double-click protection on our server, which also prevents any download twice

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

No branches or pull requests

5 participants