Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook like iframe slowing down page loading

I have a page on my website that I have added the Facebook like feature to it implemented via an frame as outlined in the Facebook specification.

The site is built in asp.net with client side development via jquery.

Performance tests on the page has shown it's now taking double the time to load than previously, with the issue being the introduction of Facebook iframe.

So need to fix this. Any tips or suggestions? Could a possible workatoubdcbe the loading of the iframe ayschraneously?

like image 326
amateur Avatar asked May 12 '11 00:05

amateur


People also ask

Do iframes slow down page load?

So, you should not use iframe excessively without monitoring what's going on, or you might end up harming your page performance. To avoid having your iframes slow down your pages, a good technique is to lazy load them (i.e., loading them only when they are required like when the user scrolls near them).

Does iframe block Page load?

Definitely iframe affects the page load performance and also it is not recommended to use iframe for many page security issues perspective.

Are iframes slower?

There are big problems, though The talk covered some of the things that iframes (and also popup windows) are really bad at: They have a terrible reputation; historically they've been used pretty much exclusively for advertizing and tracking. They're slow to load, resulting in a pretty terrible user experience.


2 Answers

I've found this to be the case too with some of my sites. You could try using JavaScript to insert the iframe once the page has loaded.

like image 185
alex Avatar answered Oct 05 '22 23:10

alex


You can give the iframe an id and leave it empty in the src .

Wait for the body onload event and then use the "getElementById" JavaScript method to get the ID of the iframe and then input that url as the src value.

like image 39
Chris_O Avatar answered Oct 05 '22 23:10

Chris_O