Question

Why does Klaviyo Javascript take longer to load?

  • 22 April 2021
  • 7 replies
  • 354 views

Badge

Hi, 

 

before I installed Klaviyo, I wouldn’t say my site was perfect, but I would get a healthy B grade from pagespeed etc.

 

Now I get an F, and the only reason for that is Klaviyo’s javascript taking 9 seconds to load. Even loading Asynchronously, which appears to be the stock answer, it is the longest loading part of the page load.

Even the Image for the signup form pop up loads slowly, and I optimised that image to make it as small as possible.

My server is in Singapore, do you have any CDNs in the area?

Is it possible to install the javascript and image locally on my server so I don’t have the long load time?

 

I’m using woocommerce BTW.

 

Thanks

 

Steve

 


7 replies

Userlevel 1

Hey Steve, this is Hansen from Klaviyo. 

 

9 seconds is the slowest I’ve ever heard! Would you be able to share details of your PageSpeed results? I ran a test on your site and the results aren’t as bad (Klaviyo took ~220ms) but I’m not sure if it’s location-dependent since I’m in the US. 

Badge

Can you try GTMetrix and use Hong Kong as the location?

 

2nd and 3rd lines

 

Userlevel 1
Badge

I agree with 

All Klaviyo js files are huge not optmized. Loading the js libraries cost almost 1MB download for each new customer

Badge

Hi @hansen ,

any update on this?

As far as I can see implementing a CDN for at least a few parts of the world might be the best bet.

It seems Honk Kong and Malaysia have similar timings, so I would imagine South East Asia in general will suffer this issue.

Or better still, if we are using wordpress, would it be possible for us to host our own files? As I also see a really slow clunky load of the popup images as those images also come from Klaviyo, and I’ve optimised them down to a very small size.

 

Thanks

 

Steve

Badge

nothing? :rolling_eyes:

Userlevel 6
Badge +5

Hi @skabrnes and @David B.

Thanks so much for your patience while I investigated this further! I chatted with @hansen on this and, as I mentioned to @David B. in another post around loading times for .js files, our team is currently investigating ways to improve our JS performance and prioritizing work in this area.

@skabrnes regarding your questions above on Wordpress and hosting your own files…we don’t recommend that you host your own files, because if you self host, we can’t guarantee that Klaviyo features, such as forms, will continue to work properly. You could, however, upload smaller images to the Klaviyo asset library and use that to alleviate some of the loading time issues. Our team is discussing better ways to help our customers with image optimization and reduce JS sizes. We will provide an update when we learn more from the team.

Thanks so much, and we appreciate your patience on our response! 

Userlevel 5
Badge +3

@skabrnes I've actually played around with hosting them on my own site running from main domain instead of klaviyo.com domain and it did seem to work but as @cassy.lee mentioned it's not recommended. You'd need to make sure all files are always up to date etc. So wouldn't do this on production.

Also, loading custom fonts and big images in popups can sometimes also create a slowdown. Not sure if the amount of popups you have in Klaviyo (disabled or not) will also create speed issues? 

Reply