PHP Classes

What about...?

Recommend this page to a friend!

      PHP Classes blog  >  Accelerate Page Loadi...  >  All threads  >  What about...?  >  (Un) Subscribe thread alerts  
Subject:What about...?
Summary:IFrames
Messages:4
Author:Morten Olsrud
Date:2010-10-22 16:38:36
Update:2010-11-02 01:04:51
 

  1. What about...?   Reply   Report abuse  
Picture of Morten Olsrud Morten Olsrud - 2010-10-22 21:59:28
I know, I know, it's not nice, but having empty iframes during pageload in the correct size and when the main content i loaded you just tell them with javascript to go to the html-page which houses the ad-link scripts.

Come to think about it I believe perhaps this would also let you load it all at once, and the content of the iframes would not delay pageload.

Otherwise I recommend you look at the sourcecode of fastloading pages with heavy content like online news and such. Here in Norway I can currently think about this page off the top of my head: www.vg.no. Its a norwegian newspaper with tons of flash and gif ads, but it loads surprisingly fast. Quite intruiging javascripts used.

Cheers!

  2. Re: What about...?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-10-22 22:21:12 - In reply to message 1 from Morten Olsrud
Right, as mentioned in the article images and inline frames, as you have in that page, do not delay the load of the rest of the page, as the content is loaded in parallel.

The problem is with content retrieved dynamically from remote Web servers using JavaScript. That is what most advertising systems use.

Inline frames could be used but they have further inconveniences that make them an inviable solution.

For instance, in the case of Google AdSense ads, internally it uses inline frames but you cannot put AdSense tags inside iframes yourself because AdSense needs to know the exact URL of the page where the ads are showing.

The matter is that AdSense shows ads related with the page content. It sends a robot to scan the content of the page so it can figure what is the context of the page content and so show related ads.

If you show AdSense ads inside inline frames, AdSense code sees the URL of the inline frame instead of the URL of the main page. Therefore it is not able to target the ads to the content of the main page.

Other than that, if you load content in parallel in inline frames, as mentioned before, it still slows the load of the main page content.

  3. Re: What about...?   Reply   Report abuse  
Picture of Thomas Churchill Thomas Churchill - 2010-10-23 22:01:56 - In reply to message 2 from Manuel Lemos
Manuel, a solution I use occasionally when I want the Google Ads in an iFrame but still want the ads to be relative to the content of the page, is to dynamically create the page meta tags with PHP. In our case, the page is usually a news story or a series of news stories retreived from storage in a adatabase which does make it a bit easier. If the main page has content about an election in Haiti for example, when the iFrame is drawn it is called with URI that points to the same story content in the database. A quick but of PHP code on the inline ad iFrame reads the story, creates the keywords, description, and if you like even puts the text on that page but below where the ads appear (made to be non-scrollable and non-visible), and voila! Google's robots read the tags and content and choose ads that match what's in the top frame.

  4. Re: What about...?   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-11-02 01:04:51 - In reply to message 3 from Thomas Churchill
Well it is not the same showing the real ad in the page without iframes but that could help minimizing the contextualization of the ads. Another solution could be to redirect the AdSense bot to the main page when it accesses the ad iframe. That way AdSense bot would index the real page.

Anyway, iframes still delay the page loading a bit because they attempt to load in parallel with the rest of the page.