There are so many things to consider when making pages in Wix and Wix Code that I believe should really be on the server-side of things.
I have a client which I tried to help making their page faster, the answer they got from Wix Code Team was, hide all elements on your page that have dynamic data, load the data after the page has been rendered and then show the elements.
So just to make things really clear for everyone, can some one make a tutorial on this from the Wix Code team for everyone to work by?
I would be more interested if Wix platform could only load the stuff within the viewport and skip the rest until the page is fully loaded.
But, dreaming is a nice thing on Mondays 
So, I have a page with repeaters on it… I click hide on load on all of them. Then in the onReady function right? In that onReady I will start querying the data collections, get the data, send the data to the repeater and then when looped through use the .show() method to make it visible.
Is this the correct way?
If where do I put the SSR if statements in this setup to make use of Server Side Rendering?
1 Like
Hello Andreas,
Yes that is correct, hide the elements that display the dynamic data using hide on load checkbox in the tooltip. Do your queries, get the data, display them in the elements. Then when that is done, show the elements.
This can be done with promises . then() or using the new async/await feature in ES6. In my experience async/await is a bit faster.
More on those here:
Promises
Async/Await
Hope this helps,
Majd
Ok then. So I did two pages for testing this theory now. There is a header, there is a strip with a background image and then there is a repeater. The repeater is connected to a Dataset which is configured to show 40 records from my Data Collection.
Speed test Page 1:
https://andreaskviby.wixsite.com/demosite/speedtest-page-1
On Page 1 the repeater is visible and not hidden on load at all. Using the well known Pingdom Speed testing tool this page gets the below results.
So test 2 here would be just as a start to hide the repeater on load using the properties panel and just check it as hide on load. In my opinion this would speed up the page a lot because the repeater is hidden, right?
Speed test Page 2:
https://andreaskviby.wixsite.com/demosite/speedtest-page-2
So, on this page there is no repeater, it is hidden on load. Testing through Pingdom again.
Strangely enough this page is way slower than page 1, there is no repeater on this page at all. I am confused now. So now you mean that if I load the data, set the data to the repeater and show it that will be faster than both page 1 and page 2 then?
Hello Andreas,
I did the speed test and both received a score of 96.
Can you try once more?
The point of hiding the element is to hide the updating and retrieval of the data from the user until all items are retrieved, not for performance.
Hi
Yes I now get 96 in performance grade as well. So what do we say to clients who stare them selves blind on the seconds and not performance grade. I think we just highlight this somewhere, make some kind of test panel or something where this will be tested and taken care of.
There is a huge risk that people even myself create sites that tend to not be performing as they should and then that will hit us back because all of the talk right now how much clients you will loose if your performance goes down.
Do you have any ideas on this matter I would appreciate your time.
Haha unfortunately, Andreas, dealing with clients is not my area of expertise. I would recommend telling them performance is based off of size of the pictures/videos/and other media and most things in our field is a tradeoff - in this case do they value performance or higher quality media.
In regards to retrieving data, your best bet in speeding up performance is using async/await and trying to reduce how many API calls you make - refactor your code, but even if you have the most efficient code, large data will take time, no way around it; not much more you can do then that currently. Since Wix Code is mostly API calls, you don’t have much control in this regard.
Best,
Majd
Oh I had some great success in increasing the speed on my page now from a bit over 2 secs down to 1.1 sec.
Very nice! Keep up the good work, you’re dedication on these forums is inspiring :)!
It’s my mission, I am like the Knights with the Crosses in history but for WIX 
So… How dit you manage to increase page speed, if I may ask?
Please add your own issue into a new post instead of bumping up an old post. Explain what you are trying to do, what works, and what doesn’t. Also, add any code in a code block as stated in the Forum Guidelines .
This is an old post and is being closed.