Advertisement:
NameCheap

Author Topic: A better way to load ads scripts so don't compromise the general load (or?)  (Read 5703 times)

Offline distante

  • SMF Hero
  • ******
  • Posts: 2,013
  • Gender: Male
  • Me pueden encontrar en : www.smfsimple.com
    • LosDesadaptados on Facebook
    • @LosDesadaptados on Twitter
    • Desadaptados.net!
I'm my way to trying to do my site faster, I find out that ad scripts are one of the most important causes of the delay in the charge of a site.

Since many site lived from ads, remove them isn't an option.

I'm thinking in use iframes to load them, in this way:

  • MAINSITE-> [Iframe to load.html]
  • Load.html [contains refresh meta tag to ad.html with 2 to 4 seg]
  • ad.html [have the ad script]

So far (I think) is good Idea, BUT, I found this article : http://www.stevesouders.com/blog/2009/06/03/using-iframes-sparingly/ where this graphic is showed:

Time To Create 100 elements


Since I'm not familiarized with DOM, I'm not quite sure if the Iframe is a good solution anymore....

Opinions?  ::)
If I was of any help, please consider link one of my sites in your forum or mod :)
Si te fui de ayuda considera likear uno de mis sitios
www.desadaptados.net - www.musicaysonido.com
Adsense Compatible!!





Offline distante

  • SMF Hero
  • ******
  • Posts: 2,013
  • Gender: Male
  • Me pueden encontrar en : www.smfsimple.com
    • LosDesadaptados on Facebook
    • @LosDesadaptados on Twitter
    • Desadaptados.net!
I think I post in the wrong board :\
If I was of any help, please consider link one of my sites in your forum or mod :)
Si te fui de ayuda considera likear uno de mis sitios
www.desadaptados.net - www.musicaysonido.com
Adsense Compatible!!





MrPhil

  • Guest
I'm no expert on this, but I could see an iframe being slower than in-line ad code, simply because the browser is being told to go out and load another page to populate the iframe. There's extra overhead in doing that.

That said, if a third-party site is slow to serve up content for the ad, I don't think it's going to make much difference if your page has to wait for the content anyway. Your only hope (other than only carrying ads from sites that load fast) may be to rewrite the ad code so that it asynchronously preloads the ad content. Javascript to do display of multiple large images (to be displayed one at a time) does something along these lines -- it brings up the page (with the first image) and while it's waiting for the visitor to perform some action (such as select a picture or ad to view), it is busy loading  the other images to (possibly) be viewed later. Perhaps something like that can be done for your ads: to load some placeholder first and while the visitor is staring at the screen, be loading the other ad content. Then you can rotate in the ad once it's fully loaded.

Offline distante

  • SMF Hero
  • ******
  • Posts: 2,013
  • Gender: Male
  • Me pueden encontrar en : www.smfsimple.com
    • LosDesadaptados on Facebook
    • @LosDesadaptados on Twitter
    • Desadaptados.net!
The asynchronously load was my first idea (like the facebook sdk), but one of rules in the TOS is to not touch the script.

In the other hand, if the ad don't charge until the user scroll, then if he don't scroll that will be "money lost" =\
If I was of any help, please consider link one of my sites in your forum or mod :)
Si te fui de ayuda considera likear uno de mis sitios
www.desadaptados.net - www.musicaysonido.com
Adsense Compatible!!