Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Does iframe affect the page load time? and is there any alternative for iframe??

user-image
Question added by marwa khalaf , .Net Developer , Sands National Academy
Date Posted: 2014/02/06
Muhammed Effat Ahmed Afifi
by Muhammed Effat Ahmed Afifi , Project Leader [Microsoft Business Unit] , Wipro Arabia Limited

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

You can use instead of iframe : javascript/jquery

this will help  :

http://www.dreamincode.net/forums/topic/195687-iframe-replacement/

Zubair Ali
by Zubair Ali , Software Developer III , S&P Global

IFrames cause another call to server after receivin the response. N number of Iframes on a page cause page to perform minimum n+1 calls to server(s).  [increases round-trips, transportation and communicaton cost]

SEO companies strongly discourage iframes. 

 

Are now only used for either display of contents with different content-types i.e PDF or might be for some other needs of time.

هاشم المشارقة
by هاشم المشارقة , Key Account Manager , Advanced United Systems Ltd. ( A member of Taj Holding Group)

Of course if your page include many iframe tags it will be slow due to load many pages.

Yes, there is another alternative but it is older than iframe it is frameset tag

 

There is one alternative to <iframe> and that's the <object> tag.

Farhaj Uddin
by Farhaj Uddin , Coumputer Programer analyst (PHP) , Teacher Parents council

The onload event isn't guarenteed to fire after all of the DOM has been loaded.

Quite often you'll find the onload event firing way before the DOM has fully loaded, as many a Javascript developer can tell you.

I'd summise from this that your iframe will have little, if any, effect on the onload event firing.

Muhammad Zahid
by Muhammad Zahid , IT Project Manager , Cozmuler (PVT) Ltd

iFrames are somewhat costly, even when left blank when compared with other HTML elements. The biggest drawback is that they block the window onload event until complete, which can make the users perceive that the page they requested is slow.

The do have their uses though in allowing you to compartmentalize external web pages or sandboxing another DOM structure outside of the main page.

Muhammad Abid Ansari
by Muhammad Abid Ansari , Senior PHP Developer , Freelancer

Yes iframe effects page loading time and alternative depends on your needs.

Rameez Ahmed Sayad
by Rameez Ahmed Sayad , .Net Consultant , Proximus Luxembourg

My thoughts on this, Presuming you're talking about external sites , If we want alternate to Iframe , don't think there is one foolproof, If we go with CORS enabled AJAX web services , we still need some signature or some dependency for making sure the parameters are same. 

Infact if we check SharePoint Apps , they are encouraging Iframe as it gives cleaner separation between2 apps to interact with one another.

Hamid Anjum
by Hamid Anjum , Team Lead \ Sr. Software Engineer , University of Business and Technology, Jeddah

The Problems with iFrame:

- Bad For SEO

- No real performance gains.

- <iframe>s Are Bad for Usability

- <iframe>s Can Be Insecure

 

Alternate:

Masterpages in Asp.net  

OR

 

i am showing jQuery  example that includes another html page into your document. This is much more SEO friendly than iframe.

 

<html>

  <header>

    <script src="/js/jquery.js" type="text/javascript">

  </header>

  <body>

    <div id='include-from-outside'></div>

    <script type='text/javascript'>

      $('#include-from-outside').load('http://example.com/included.html');

    </script> 

  </body>

 

 

</html>

Anything you add to your page will affect its load time: CSS/JS files, images, iframes or even a text, since everything is loaded by the client.

 

The matter is: you have to try to deliver your assets in a way that is convenient to the end user, this is why you read or hear things like:

  1. Optimize images
  2. Use Async javascript
  3. Put JS on the button
  4. Use caching
  5. Use CDN
  6. etc...

So for iframes: if the iframe is provided by a third party, like Google or FB and that third party offers a async version, choose the async version. If that's not a choice, then you can tel the browser to wait for the important elements of the page to load, then after, add the iframe to your document with JS (jQuery is your friend).

Muhammad Majid Saleem
by Muhammad Majid Saleem , Senior PHP Developer / Project Manager , SwaamTech

Yes. Iframe affects page load time. Let me try to explain with a simple and easy example:

You have a page and where you have2 iframes added on it which have2 different urls in them. Now this page will try to load3 pages in actual when you will try to open your page.

 

Does it make any sense to you?

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.