How to check if range-requests are in use?
See original GitHub issueWe 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:
- Created 6 years ago
- Reactions:3
- Comments:19 (10 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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