Widget size/unused java script is slowing down page loading time significantly.
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!
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
To turn it on, please add the ādata-elfsight-app-lazyā attribute to a
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
Hi @Niels, welcome to the community forum!
My apologies for this, it seems the codes got distorted when transferring from the previous portalābut all is good now
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
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 I totally understand your point.
Weāll try all our best to improve it and make our customers a bit happier!
Thanks!
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.
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
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?
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