Why is cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js?ver=5.8.2 slowing down page rendering?

In attempting to speed up or post page loading the following is listed by Google’s Page Speed Insights as the biggest culprit in slowing down rendering our our post pages:

https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js?ver=5.8.2

Does anyone know what this is and how it can be disabled or optimized?

That is a javascript library that is used by your site. You can try removing it but it will likely break something. Another option would be to load it directly from your site but that might not improve your speed.

You can try using the defer attribute if the library supports it (if you aren’t initialising something in your own scripts).

The defer attribute pretty much says to the site that it can load without waiting for that script to download.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attr-defer

Good points above, you can also try cloudflare rocket loader too in the speed menu, it either works great or not at all, each site is different which ok.

I use it on more sites than not these days, just another option for OP to try.

But if they’re not a Cloudflare customer, that’s not an option. It sounds like they have a site that doesn’t use Cloudflare, but they have a third-party plugin that uses a JS hosted at cdnjs.

We do use Cloudflare free tier service as part of our hosting plan at Siteground. Thanks for the advice, I will look into these options.

Thanks folks!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.