How I made my home page load faster

So my website Apartments near me is website that provide real estate management services - and that not the topic of this post :slight_smile:
(btw, yes my English is not my best - sorry for that, please try to ignore my grammar and focus on the topic)
My landing page have repeaters with to include blog posts, a youtube video to run on view, ability to sign in as a member.
Now I tried to make my page run fest, I tried everything wix have to offer and other blogs, from removing animations, to have one font type, to reduce img size and put heavy content below the fold.
I have talked with support many many times to make my page to load fester - and by google lighthouse nothing really worked. while Wix continue to argue that google speed ranking is no the actual speed and the site is much fester, but by google SEO ranking and webmaster platform the speed is important for user experience hence its can increase or decrease the overall ranking.
now apartment near me have the below figures (tested in Memphis TN)

Which again is not good, but at least it’s not red. and I was able to keep all the things I wanted to keep.
and now I will share how I did it.
So first think I removed the widget for video as I seen in the waterfall load that its have a lot of calls and script to run even if its below the fold. so I created and I frame and used the on view to load the JS to run the youtube video I needed (code below)

Iframe code:
<!DOCTYPE html>
<html>
<style>
.img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}
</style>
  <body>
    <!-- 1. The <iframe> (and video player) will replace this <div> tag. -->      
<div id="player" class="img"></div>
    <script>
    var elmnt = document.getElementById("player");
      // 2. This code loads the IFrame Player API code asynchronously.
      var tag = document.createElement('script');
	  var firstScriptTag = document.getElementsByTagName('script')[0];
		var player;
		var height ='290';
		var width='440';
	window.onmessage = (event7) => {
	if (event7.data) {
	tag.src = "https://www.youtube.com/iframe_api";
	firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
	
				//const vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
			const vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
				height=vh*0.9;
	width=height*1.78;

}
	};
      
      //var firstScriptTag = document.getElementsByTagName('script')[0];
      

      // 3. This function creates an <iframe> (and YouTube player)
      //    after the API code downloads.
      //var player;
 	    function onYouTubeIframeAPIReady() {
        player = new YT.Player('player', {
          height: height,
          width: width,
          videoId: 'ZhjboEODPyI',
          events: {
            'onReady': onPlayerReady,
          }
        });

      }

      // 4. The API will call this function when the video player is ready.
      function onPlayerReady(event) {
        player.mute();
        event.target.playVideo();
        player.loadPlaylist('ZhjboEODPyI');
        player.setLoop(true);
      }

      // 5. The API calls this function when the player's state changes.
      //    The function indicates that when playing a video (state=1),
      //    the player should play for six seconds and then stop.
     
      function stopVideo() {
        player.stopVideo();
      }
    </script>
  </body>
</html>

and the corvid code is:

export function page1_viewportEnter(event) { //its an event on the iframe no the page
	$w("#html1").postMessage("do");
	// Add your code for this event here: 
}

basically what it does is that the iframe youtube not loads JS to run the video until the view of the iframe.
next was the repeater of the recent blog posts.
Was I used the blog post widget I seen that again the call backs is very high and it’s load even when its below the fold. so use the same Technic with the I frame but with repeaters and a collection:

var bload=0;
export function viewblog(event) {
	// Add your code for this event here: 

if(bload===0){
	 $w("#repeater1").onItemReady( ($item, itemData, index) => {
    $item("#Rimg").src = itemData.coverImage;
	$item("#Rimg").link=itemData.postPageUrl;
	$item("#Rtitle").text= itemData.title;
    $item("#Rdate").text = itemData.lastPublishedDate.toDateString();
    $item("#Rbt").link = itemData.postPageUrl;
  } );

	bload=1;
  
  wixData.query("Blog/Posts")
  	.descending("publishedDate")
  	.limit(3)
    .find()
    .then( (results) => {
      $w("#repeater1").data = results.items;
    } );
}
}

the reason for doing like that and not a data set and connect the data directly to a repeater is that on page load the data-set start running creating a drew back on load.

One last thing I did a wall is to remove the FAQ app from the page and doing it directly with text and adding the schema with Corvid SEO.
there was 2 issues with the app,

  1. by google webmaster the auto generated schema from the app for FAQ was not reading correctly and google didn’t fetched the FAQ.

  2. in the on page schema (in the advance SEO setting of the page) its not letting you use html tags and give you error, and my FAQ have links in it.
    Just make sure to run it like that because there is no reason for the code to run twice

$w.onReady(function () {
 //TODO: write your page related code here...
 if (wixWindow.rendering.env === "backend"){//"browser") backend{    
    wixSeo.setStructuredData(
        [{ //you schema :)

I would like to hear from you what you think and if it was helpful for you,
if you have other tips of how to make things run fester please share.
Thank you :slight_smile:

1 Like

Great, very beautiful!
Some questions, based on solutions I made.

  1. At what stage did you activate the viewblog function? Seemingly the best here too ‘page1_viewportEnter’

  2. In this context I also think that everything that comes in here
    $ w.onReady (function () {
    Delays loading the page I put everything that is usually put here, I also put it in this function ‘page1_viewportEnter’
    This way the elements come up immediately, and the content as soon as the page loads, if there is something that does not look good, I fold it and open in this function afterwards.

  3. Why did you not enter the query
    Also within the
    if (bload === 0) {

  4. What do you do if there are more than 3 items, I guess you have more because if it’s only 3 you may not have needed a query at all. What I do when there are more items, I really upload a small amount first, then query in the backend and move to the page, and save in the variable, and when scrolling the page adds more items from there.ה

  1. yes - (for the Ifram not the page) create event “on view port enter”

  2. so the w.onready run twice, on server and on browser, I suggest to put things there only if you need to run them on load - otherwise just create actions event

  3. look closely on the brackets “{” it in the if statement

  4. in the query i put limt(3) to limit the results to 3, as i want to load only 3 repeaters, but you can limit to how many you need

I also sat a lot on the issue of charging speed, especially with the repertoire.
I would be happy for your recommendation on the matter, and your impression, of this site.
I feel like I’m not lit yet. Thanks
https://www.malaya.co.il/

you current performance is as below:

The animation and the scrolling feels great, but the chat bot with the loading is creating a slow load, as you can see above.
Try to run script after load. Wix is very resource consumable on page load. so we getting easy platform to build websites, but with a drag on loading (that the barging)
SEO:
Words from the H1 heading are not used in the page content.
There are only 352 words on this page. Good pages should have about 1,000 words of useful content.
4 images have no alt attribute. The content of alt attributes is used by search engines.
Too many H1 headings (should be only one)
Some headings occur twice on the page.
The structure of headings is missing one or more levels. Do not skip heading levels.
There are 41 headings on the page. The amount of headings should be in a more proper relation to the amount of text.
1 links don’t have an anchor text.

Hey man I truly appreciate your tips since I’ve been trying to speed up my site since day one…

Would you mind checking it out www.soyamigo.com and give me your thoughts?

Appreciate it and keep up the good work

you current preformance is:


errors:
you Fb connection JS:net::ERR_BLOCKED_BY_CLIENT
I suggest to put the galary below fold and have a strip with img above fold to lower the LCP and FCP speed
you logo is cut off (see pricture):


you have whatapp and chat app on same page, I suggest to choose one,
SEO:
Some words from the page title are not used within the pages content
No paragraphs were detected.
These Typos were found:

very important: There is no H1 heading specified.
There are 73 headings on the page. The amount of headings should be in a more proper relation to the amount of text.
Some internal links have dynamic parameters. All internal URLs, which are not marked as nofollow, should not contain dynamic parameters.
1 links don’t have an anchor text.

@ricprud
Thank you Thank you for taking the time.

I did not notice the new possibility of SEO in the text tool.
I would love to read some guide to learning the right settings.

Is there a way to delay loading an added HTML script in an external code through the code tool?

By the way if I am not mistaken the editor X his result is better the site built on it faster.

I would be happy to pay you if you can take the time to sit down with me on the site to improve speed.

By the way, I kind of think that Google’s ranking is not absolute, which means that there are other sites that rank differently, and not necessarily that Google is right.
Here for example

In my opinion, the index is reality, what the surfer sees.

Hi,
I’m facing a big issu with my corporate wix web site : www.brokins .fr
It takes second to be fully loaded.
Is there a way (maybe technical) to reduce by 3 the loading time ?
Regards

This forum is dedicated to Corvid. Since you are not using code on your site, you should contact Wix Customer Care . You’ll get better help for your problem there.

You can use the prefetchPageResources() function to optimize resource fetching of pages and lightboxes you think your site visitors are likely to visit next.

Hi,
Thanks for your quick answer.
Wix Customer Care said that my website is speed enougth and i mustn’t believe what free speed online tests are saying :slight_smile:
I publiched this post on this forum because i thought that with code (CORVID) i could find a solution.

Regards

I agree with Customer Care regarding free online speed tests.

One thing I noticed in your site is that you incorrectly tried to embed HTML code in the Corvid code pane. This causes undefined errors and will slow up the page.

Thank you.
I don’t understand this error. I’ve just used a third party Contactform proposed by wix (in their library) to catch email contacts in the newsletter.
This contactform works as an iFrame, that why we have this line (this code) on this page. I’have never whrite this line by my own.
I will raise a ticket to WIX so they can explain we why is tere an error.

Thank you.

Where was this script proposed by Wix?

All code in Wix Corvid is Javascript, however you don’t have access to the DOM. You can add HTML into your site, however it has to be either through an HtmlComponent (iframe) on your page or through the use of tracking and analytics.
https://support.wix.com/en/article/using-iframes-to-display-visible-content-on-your-site
https://support.wix.com/en/article/embedding-custom-code-to-your-site
https://support.wix.com/en/article/corvid-working-with-the-html-element

I don’t realy know how i did it. I’m sure that i followed a step by step expliantion by WIX support to create a contact form which it’s displayed as and iframe.

Sorry, i understand. I comes from sendinblue third party.

@av-promotional
you right, google is not absolute, but its using it own ranking and measurement system so even if it off, its still being evaluated by it. regarding html script you can use Ifram for that.
regarding editor x, I’m not fully sure what is that means, I’m using corvid script to do all kind of things.
regarding talking with me in privet, you can email me here:

info@apartmentsnearme.biz

I just hope its not against the rules for this forum:
Admins: if its please let me know.

thank you, I didn’t knew about this option.
that is great.
Can you explain when its load? can you explain what is the best practice of using it?