Js files are sometimes slow to load

WebViewer Version:

Do you have an issue with a specific file(s)? webviewer-core.min.js, webviewer-ui.min.js
Can you reproduce using one of our samples or online demos? No
Are you using the WebViewer server? No
Does the issue only happen on certain browsers? No
Is your issue related to a front-end framework? Yes
Is your issue related to annotations? No

Please give a brief summary of your issue: Some webviewer files are loading slowly (sometimes)

Please describe your issue and provide steps to reproduce it:
On load, webviewer-core.min.js, webviewer-ui.min.js are always slowly than they should be to load (473ms for a 941kb file, for instance), and sometimes are EXTREMELY slow to load, taking upwards of 30 seconds!

There is nothing special I am doing to make this happen. Sometimes it happens, sometimes it does not. I would say it happens about 5% of the time that it takes 30 seconds to load, but the slightly too slow loading is 100% of the time (almost 500ms to load a 900kb file is much too slow).

I’m not sure what is happening in the file (is it doing an api call to check the license or something?) but it is taking too long. I have already run through as many optimizations as I can to speed things up, but am at a loss. I can not “preload” the files as the very first page of our site uses the webviewer, so we need it to work right away.

This issue happens with random pdfs, for random users, at random times. I have to believe it has something to do with an api call to the pdftron servers to check licenses or what not, which is almost certainly a blocking call.

Please help!

Thanks,
Jeff

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Hello jdemers,

Unfortunately it’s difficult to investigate further without being able to reproduce the issue on our side. Would you be able to provide any code snippets we can use to try and reproduce the issue? A sample project could also be useful as it may be something in your customized code that is causing the issue.

Best Regards,
Carlo Mendoza
Software Developer
PDFTron Systems, Inc.
www.pdftron.com

Has no one reported this issue before?

Can you confirm if there is a rate limited api call in the package somewhere? If 1000 users all try and load pdfs at the same time, does the library call to check the license key for each load, meaning 1000 users all hit your servers to check the license at the same time? If that happens, do you rate limit?

Thanks!

Hello jdemers,

We can confirm that there are no rate-limited API calls or API calls that should be blocking load times like this. The slow loading times could be caused by the server that is serving the files. We have this guide on how to load some of the larger files from a CDN or external server, which may improve the loading time, but this shouldn’t be an issue caused by WebViewer itself.

Hope this clarifies some of your concerns.

Best Regards,
Carlo Mendoza
Software Developer
PDFTron Systems, Inc.
www.pdftron.com