-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
[api-minor] Add an optional param to DocumentInitParameters for speci… #6568
Conversation
@@ -299,6 +302,9 @@ PDFJS.getDocument = function getDocument(src, | |||
source = src; | |||
} | |||
|
|||
// Default range chunk size to 2^16 = 65536 | |||
source.rangeChunkSize = source.rangeChunkSize || 65536; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make 65536 a constant (at least justbefore this statement).
Can you use params
object (instead of source
) -- we don't want to mutate the original parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As alternative, you can move the constant and default value replacement into the ChunkedStreamManager constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, decided against adding the default in the ChunkedStreamManager constructor since we still need that value in getPdfManager() in worker.js.
4a4ed0f
to
ef66782
Compare
…fying the range request chunk size to use. Defaults to 2^16 = 65536.
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/c8faf1d391aea64/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/c8faf1d391aea64/output.txt Total script time: 0.62 mins Published |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/79ecf3b2c1afe12/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/33bf79a026990df/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/79ecf3b2c1afe12/output.txt Total script time: 18.69 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/33bf79a026990df/output.txt Total script time: 19.81 mins
|
Looks good to me. |
[api-minor] Add an optional param to DocumentInitParameters for speci…
Thank you for the patch |
Whoo! |
…fying the range request chunk size to use. Defaults to 2^16 = 65536.
This would allow developers to configure the range request chunk size that best matches their performance and usage needs.
For example, an app serving PDFs that are mostly smaller than 512KB in size can set a range request chunk size of 256KB. Since we don't download with range requests if the file size is less than 2 * chunk size, the majority of PDFs in this app are fully downloaded and cached. For the remaining larger files, the app can still benefit from downloading via range requests.