question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to check if range-requests are in use?

See original GitHub issue

We are having a hard time serving large PDFs to our customers with pdf.js. Some investigation learned us that the concept of “range requests” could fix this. Therefore we tried to generate a fastWebView-enabled PDF with ghostscript:

gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dCompatibilityLevel=1.5 -dFastWebView=true

The generated PDF is being served by Apache/2.4.18 which (correct me if I’m wrong) supports range requests.

Now how can I test that pdf.js actually uses range requests?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
yurydelendikcommented, May 22, 2017

PDF.js has two other options, disableAutoFetch and disableStream. The former stops any range-requests downloading if enough data is fetched, the latter disables fetching for progressive download capable browsers. See also #7937 and https://github.com/mozilla/pdf.js/wiki/Debugging-PDF.js#url-parameters

0reactions
vedidinakarcommented, Aug 17, 2022

We have a pdf of size 200mb i want to load first 1 page once its downloaded to the browser. Can you please help me a way to achieve this

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP range requests - MDN Web Docs - Mozilla
We can request a single range from a resource. Again, we can test a request by using cURL. The " -H " option...
Read more >
How can I find out whether a server supports the Range header?
You can use GET method with 0-0 Range request header, and check whether the response code is 206 or not, which will respond...
Read more >
Handling range requests in a service worker - web.dev
Handling range requests in a service worker. Make sure your service worker knows what to do when a partial response is requested.
Read more >
How to check if the range header is supported in requests?
You can make a requests.head() request to the URL and then check for the Accept-Ranges key in the response headers dictionary.
Read more >
Check whether HTTP server supports "Range" request header
However, I find that it is possible for servers to ignore that field. As per HTTP specs, checking the "Accept-Ranges" field doesn't seem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found