Author Topic: iframes adds and lags...  (Read 791 times)

Offline Blacklava

  • Level 10
  • *
  • Posts: 59
  • Reputation: +1/-0
    • View Profile
    • CitySlaves browser RPG
iframes adds and lags...
« on: February 25, 2010, 03:42:43 AM »
Hi,

I'm using iframes for adds (served from other domains) but those are crashing/lagging my website when that third party hosting is laggy... how to be sure those iframes won't slow down my site?
I know the best tip would be to use only adds from very stable services but they will be down one day or another for a few minutes anyway so the question still here.

Thanks for help!
CitySlaves browser RPG - Play free games at 85play.com - Free online poker

Offline dsheroh

  • Level 21
  • *
  • Posts: 235
  • Reputation: +6/-0
  • Perl Vicar
    • View Profile
    • Psi Rangers
Re: iframes adds and lags...
« Reply #1 on: February 25, 2010, 04:17:51 AM »
It's been a couple years since I last used iframes, so my memory is a little foggy, but I would expect that giving them specific height/width should allow browsers to figure out the rest of the page layout around them without having to wait for the ad to load.

Offline Blacklava

  • Level 10
  • *
  • Posts: 59
  • Reputation: +1/-0
    • View Profile
    • CitySlaves browser RPG
Re: iframes adds and lags...
« Reply #2 on: February 25, 2010, 05:57:27 AM »
hmm not sure if that's the issue, seems height/width are fixed.

any way to test a domain "speed" through php perhaps?
I can only check if a website is up or down...
CitySlaves browser RPG - Play free games at 85play.com - Free online poker

Offline dsheroh

  • Level 21
  • *
  • Posts: 235
  • Reputation: +6/-0
  • Perl Vicar
    • View Profile
    • Psi Rangers
Re: iframes adds and lags...
« Reply #3 on: February 25, 2010, 06:33:39 AM »
If you're using Firefox, the Firebug plugin has a 'Net' panel which will display a timeline of all the requests made in the course of rendering a page.

Assuming the site you're asking about is CitySlaves, I just timed the front page with Firebug and came up with a total of 5.42 seconds from the time I told the page to refresh until the 'onload' event fired.  Of that time, the image from game-advertising-online.com started at 1.29s and completed at 4.13s.  The graphic took about 2s to retrieve, but your newtop, newtop3, newleft, and newmiddle gifs each took about 2s to retrieve also, so the ad isn't being exceptionally slow.

Layout wise, I'd say that the ad probably isn't the issue.  I immediately got a white box on the right side of the page which patiently sat in the same place as it waited for the image to appear in it and did not have any obvious effect on the rest of the page.  The main thing I noticed shifting around as the page loaded was the login section; offhand, I'd say that this is probably because the column to the left of it (where you're loading in newmiddle.gif) doesn't have a width set, so it changes size as the image it contains is loaded.  Set width=44 (or maybe a little more if there's padding to account for) on that column and the login box should sit still as the page loads.

Offline Blacklava

  • Level 10
  • *
  • Posts: 59
  • Reputation: +1/-0
    • View Profile
    • CitySlaves browser RPG
Re: iframes adds and lags...
« Reply #4 on: February 25, 2010, 06:55:52 AM »
I was referring to my site yes but not that add, I've experienced the issue loading iframe while using Adertiseyourgame iframe (which is down 5% of the day or too slow at least... Crazy but real), when including their iframe on my page it simply block the loading when it's laggy on their end!

Their code inclused width/height for iframe...
<iframe marginheight=0 marginwidth=0 scrolling=no frameborder=0 width=300 height=250
src=http://www.advertiseyourgame.com/publish/?a=1049&b=7&c=e3t97V2UfC00IKA2jEDJ0eNeoUY8uHEQJkJyJHXoJH9wlEBEtn0iHOQY4fzNW0UISrS850sIP81Sh2LmiLFAjqpPIjwwsxoBM3Ua&d=300&e=250&f=#FFFFFF target=_new></iframe>

It was the same for 2 other banner systems and it's worse if using direct javascript (same effect in fact), it's not really iframe related just I can't get how to have my page "skip" slow loading component instead of trying forever to handle those...

CitySlaves browser RPG - Play free games at 85play.com - Free online poker

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: iframes adds and lags...
« Reply #5 on: February 25, 2010, 08:55:50 AM »
This is a stab in the dark as I'm not sure how number of connections work with iframes. Are there any JavaScript downloads that are taking place at these times? JavaScript downloads block concurrent downloads until they've finished downloading. But, again, I'm not certain if you have 2 downloads for the site and an additional 2 for the iframe's content...
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Blacklava

  • Level 10
  • *
  • Posts: 59
  • Reputation: +1/-0
    • View Profile
    • CitySlaves browser RPG
Re: iframes adds and lags...
« Reply #6 on: February 25, 2010, 09:02:19 AM »
ah I see, so if the iframe include any kind of javascript it might block the parent window too until it resolves/load, that's the idea?
I still don't know how to solve such issue in a good way
CitySlaves browser RPG - Play free games at 85play.com - Free online poker

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,134
  • Reputation: +26/-1
    • View Profile
Re: iframes adds and lags...
« Reply #7 on: February 25, 2010, 09:16:31 AM »
Write the ad code at the bottom of HTML code. This way you don't care if it is slow or not :)
Usually you can use DIV's positioning or this.

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: iframes adds and lags...
« Reply #8 on: February 25, 2010, 09:18:46 AM »
Well, each browser handles the 2 connection limit in different ways. However, I forgot a crucial piece of the puzzle... it's 2 connections per host. So, assuming the advertisements aren't at the same domain as your website, that shouldn't be the issue I think. Gotta love early-morning thought process... where's my coffee! ;)
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Blacklava

  • Level 10
  • *
  • Posts: 59
  • Reputation: +1/-0
    • View Profile
    • CitySlaves browser RPG
Re: iframes adds and lags...
« Reply #9 on: February 25, 2010, 09:43:01 AM »
That's what I don't get neither... for me the iframe content (which is hosted on another domain yes) should load separately and shouldn't interfere with my parent page loading  ???
CitySlaves browser RPG - Play free games at 85play.com - Free online poker

Offline Blacklava

  • Level 10
  • *
  • Posts: 59
  • Reputation: +1/-0
    • View Profile
    • CitySlaves browser RPG
Re: iframes adds and lags...
« Reply #10 on: February 25, 2010, 09:43:41 AM »
Write the ad code at the bottom of HTML code. This way you don't care if it is slow or not :)
Usually you can use DIV's positioning or this.

Ah might be a good tip, I'll try that soon
CitySlaves browser RPG - Play free games at 85play.com - Free online poker

Offline Harkins

  • Level 28
  • **
  • Posts: 420
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: iframes adds and lags...
« Reply #11 on: February 25, 2010, 11:02:19 PM »
Use Cuzillion to test different page arrangements and nestings to see what will block what in which browser... it's a great tool.

Visit #bbg on irc.freenode.net to talk browser games anytime.

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal