Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pdf.worker.js and other js files make for a large client download

1,336 views
Skip to first unread message

douglas....@gmail.com

unread,
Sep 26, 2014, 3:07:36 PM9/26/14
to mozilla-d...@lists.mozilla.org
It looks like the pdf.js files add up to about 1.5 MB that the browser needs to download. This is very large and will cause a delay for the user.

I am missing something or are there steps that can help this?

Any additional info about this would be appreciated.

thanks!

Yury Delendik

unread,
Sep 26, 2014, 3:26:33 PM9/26/14
to douglas....@gmail.com
On 9/26/14, 1:59 PM, douglas....@gmail.com wrote:
> It looks like the pdf.js files add up to about 1.5 MB that the browser needs to download. This is very large and will cause a delay for the user.
>
> I am missing something or are there steps that can help this?

1. You can run minifier: google closure worked for us, other had some
issues. See
https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#minified.

2. If you know that some functionality is not used in your PDFs, e.g.
JBIG2, JPX, some font types, you can build your own pdf.worker.js with
only functionality you need.

3. Configure HTTP server to support caching and compression.

The pdf.js (which is smaller one) is only needed for initial loading,
pdf.worker.js is loaded when document is about to be loaded. So UI/web
page will be loaded faster to give user some control/information.

Enabling HTTP server range request will allow displaying PDF documents
faster.

Thanks,
Yury
0 new messages