Reduce widget size

Widget size/unused java script is slowing down page loading time significantly.

1 Like

Folks, our former Wishlist portal, where our users shared their requests and suggestions, was transferred to this forum. Youā€™re most welcome to vote, add new ideas, and leave your comments here ā€” we surely will consider them all! :star_struck:

Original Votes: 4

Hello folks,

Iā€™m happy to tell about the lazy loading beta version for embedded widgets, that might be a solution here!

It doesnā€™t work as a built-in option yet due to a couple of unresolved matters, but you can adjust your widget manually in order to make it work :slight_smile:

To turn it on, please add the ā€œdata-elfsight-app-lazyā€ attribute to a

element in your installation code.

For example, hereā€™s how the code looks like initially:

<script src="https://apps.elfsight.com/p/platform.js" defer></script>

<div class="elfsight-app-9d3beb9e-4c72-4bd1-8ed6-XXXXXXXX"></div>

And hereā€™s how it should look like with the attribute added:

<script src="https://apps.elfsight.com/p/platform.js" defer></script>

<div class="elfsight-app-9d3beb9e-4c72-4bd1-8ed6-XXXXXXXX" data-elfsight-app-lazy></div>

Please keep in mind that it will work only for widgets which are not in the initial viewport (e.g. users have to scroll down at least for a little bit before they reach the widget).

Please let me know if it worked for you!

Hey!

The code before and after is not showing for me. Could you please update it, would love to lazy load it on my website!

Thanks :slight_smile:

1 Like

Hi @Niels, welcome to the community forum! :heart_eyes:

My apologies for this, it seems the codes got distorted when transferring from the previous portalā€”but all is good now :slight_smile:

Could you please try them and let me know if it worked?

Hi Helga,

is the widget supposed to be smaller in size now? From everything I can tell in Page Speed Insights, itā€™s not. But maybe Iā€™m doing something wrong/am missing something. I did apply the new code.

Thanks!

I am also having problems where sites like Lighthouse, GTMetrix and Google report that the payload of Elfsight is ā€œenormousā€. Anything I can do about this? Looks like it messes up my site speed quite significantly.

Hello @Niels!

This is Maksim stepping in for Helga!

I am deeply sorry for any inconvenience caused!

Unfortunately, the Reviews script size is quite big. Please accept my sincere apologies!

We are working on it and will try to improve the situation as much as possible!

Iā€™ve forwarded your request to our devs and they will try to reduce its size. Iā€™ll keep you updated :wink:

Thanks - what Niels is saying is exactly why Iā€™d made the post originally, because it slows down performance and thus affects user experience and Google rankings.

Hello @Jaytee!

Thank you for your kind feedback :slightly_smiling_face: I totally understand your point.

Weā€™ll try all our best to improve it and make our customers a bit happier!

Thanks!

1 Like

Hi @Max ,

Just did a quick test and the script is really impacting performance a lot. Do you perhaps have a timeline on when speed could be improved? Due to the big impact I think in the meantime we will stop using it until itā€™s fixed.

Screenshots of our test attached.

I would suggest to just load the latest 5 reviews and have a link to the google reviews page on Google if users want to see more. It loads quite a lot of reviews now, but no idea if that would speed up performance a lot.

Maybe an iframe that is lazy loaded would help as well? Not sure tho.

Seems that the main thing the widget is effecting is the Total Blocking time.
Also 1,369 ms total Javascript execution time, which is a lot.

Iā€™d be happy to test things out if you have beta versions ready. Feel free to reach out.

Best,
Niels

Hi @Neils,

Just to be on the same page could you please tell me whether youā€™re using the lazy-loading or not?
Anyway it would be so kind of you if you can share the page URL for me to check it out.
Iā€™m sure we can make it better.

2 Likes

Hi!

Yes I am using the lazy-loading addition. Itā€™s not on my homepage anymore, the performance simply is too bad. I could embed it on our testing environment. Would that help?

I believe it would. Letā€™s give it a try.

I donā€™t want a referring url to our testing environment so itā€™s: sandbox . fiks.nl without the space bars :slight_smile:

Thanks!

Havenā€™t tested this, but what about something like this?

var scrollLoader = function() {
// script here
    window.removeEventListener('scroll', scrollLoader);
}

window.addEventListener('scroll', scrollLoader);

Would that work u think?

Thank you. It seems we got an interesting case here. I should admit that the lazy-loading feature is quite ā€œyoungā€ if we can say so. We thoughtfully tested it in standard environments. A bunch of our customers have successfully configured it on their websites. However, it looks like we missed something and your case gonna help us revealing what. Please could you keep the widget on the sandbox page for some time and let me investigate and think a bit?

1 Like

will do!

Hi @Niels,

Just a quick update from me. Iā€™ve found that the lazy-loading feature is not working properly when a widget is being added in a late document mutation - which is happening on your site when itā€™s opened on a mobile device. By the way, the lazy-loading works on a desktop as expected. Iā€™m going to deploy the fix to our platform early next week once the change gets approved by my peers. Iā€™ll keep you in the loop. Thanks for the sample, your help is crucial :metal:

2 Likes