WebPagetest Forums
Slow Iframes - Printable Version

+- WebPagetest Forums (https://www.webpagetest.org/forums)
+-- Forum: Web Performance (/forumdisplay.php?fid=3)
+--- Forum: Discuss Test Results (/forumdisplay.php?fid=4)
+--- Thread: Slow Iframes (/showthread.php?tid=12207)



Slow Iframes - Little Hotels - 04-22-2013 09:59 PM

I am finding that three iframes on my page are consistently (well, fairly consistently) slow to load. Here is a part of the waterfall:
[Image: Capture.JPG]

The iframes are called like this:
PHP Code:
<iframe src="../prices.php?hid=<?php echo $row_hotel['hid'];?>" width="100%" height="200px" id="iframe1" marginheight="0" frameborder="0" onLoad="autoResize('iframe1');"></iframe
Could it be something to do with the onLoad?

I would like to load the iframes asynchronously after the main page onLoad has fired, but I can't find any guidance on the web that would allow me to keep the onLoad function inside it.


RE: Slow Iframes - andydavies - 04-23-2013 06:35 AM

The speed of those iframes will be dependent on how quickly the server is generating the code to populate them.

As they are for hidden panels you could lazy load them after the main sections of the page have loaded


RE: Slow Iframes - Little Hotels - 04-23-2013 08:13 PM

(04-23-2013 06:35 AM)andydavies Wrote:  The speed of those iframes will be dependent on how quickly the server is generating the code to populate them.

As they are for hidden panels you could lazy load them after the main sections of the page have loaded

I use lazy loading in some other pages (jquery and jail) and it works well for images. I've searched for jquery plugins to do the same thing with iframes and I can't find any. I am completely inexpert in all things javascript so I find it difficult (impossible!) to adapt code from other sources.


RE: Slow Iframes - Little Hotels - 04-26-2013 01:05 AM

Well it finally turned out there was no problem with my website or the server. It is the London test machine that has caused the problem. Normally I have always used London IE8 DSL for all my testing because it was the closest to my webserver and therefore should provide the most consistent results. However having investigated this problem further I found that in 20 runs the London test machine threw up painfully slow results for those three file on 6 occasions. For comparison I ran the same tests on Dublin, Madrid and Denver and got 100% good results.

In future I will probably run my tests with Madrid because that seemed to provide the most consistent results. I'll also have a more open mind when I encounter "problems".