Skip to content
View Categories

PDF Viewer is Slow!

1 min read

After you have added your PDF viewer to your page, you can run into speed issues.


Loading – Slow PDF Loading: #

Remove gZip for PDFs #

This is a common issue in WordPress sites where any things are configured by other plugins and it can use issues. gZip PDFs will disable partial loading. Due to this the PDFs will require to load 100% in order to work.

Disable gzip for PDF in .htaccess file.

<IfModule mod_headers.c>
    <FilesMatch "\.pdf$">
        RewriteRule ^(.*)$ $1 [NS,E=no-gzip:1,E=dont-vary:1]
    </FilesMatch>
</IfModule>

Further Reading at StackOverFlow https://stackoverflow.com/questions/9249243/how-to-disable-apache-gzip-compression-for-some-media-files-in-htaccess-file

How to check gZip status for a file?

You can use the link to your PDF and enter that at https://www.giftofspeed.com/gzip-test/ to test the gZip status of a file.


Optimize PDF for Web: #

PDFs on Web are not same as PDFs generated for prints. Many cases PDFs for print are use to display in PDF viewer and PDF flipbooks. This makes the plugin take a ton of time to load the PDF file. Make sure your PDF is Web optimized. PDFs are normally exported for printing and are of high quality, around 300-600dpi, which a printer requires. But for reading purposes on-screen 72-100dpi is enough. 50MB for 10 pages is not good for web use.

Optimize the PDF and make per page average as max as 500KB or less. Recommended per page size is 250KB.

https://www.iskysoft.com/edit-pdf/optimize-pdf-mac.html

https://sourceforge.net/projects/workerpdf/

Leave a Reply

Your email address will not be published. Required fields are marked *