I have ads from a number of third parties: Adsense, ContextWeb and LakeQuincy. They all operate using javascript. It seems to me that this is the bottleneck on my forum, which is Access World Forums
Is there anything I can do that could make the ads load faster? I know CloudFlare has some script called Rocket loader. Wondered if there is a similar product or service as I am already using MaxCDN so CloudFlare is partially redundant.
There aren’t any really good solutions for generically loading ads asynchronously. You pretty much have to ask you ad providers if they have an async or iFrame embedding solution.
The only ones I’m aware of are:
Doubleclick - Has a fully async embed solution, even the targeting code is loadable asynchronously
Adsense - the main JS is blocking (though cacheable) but they load the ad itself in an iframe so the ad performance itself should not impact the page
Where Are the ads/scripts in the html code, put a blank image and a <div id="load_top"> </ div> and remove the source script of ads.
At the end of loading the page, put
[code]
This line, replace with the source script lines for ads.
</ div>
window.onload = function () {
document.getElementById ('load_top'). appendChild (document.getElementById ('load_top_footer'));
document.getElementById ('load_top_footer'). style.display ='';
}
[/code]
Then the banner will be rendered after the rest of elements of the forum.
The ADS will not load faster, but the feeling for anyone visiting the forum will be something lighter.
Best Regards.
“Wondered if there is a similar product or service as I am already using MaxCDN so CloudFlare is partially redundant.”
Just a quick note that there is no conflict using CloudFlare and MaxCDN and you should still see a performance boost.
Rocket Loader does, however, have the potential to break some JavaScript and jQuery & CloudFlare users should turn this off if they see something breaking.
Isub, I was very interested in what you posted and hope it will be the solution to my woes! Are you saying that the ads will no longer delay the loading of my forum content? I believe the ads currently add about 6 seconds to the typical loading time.
Couple of questions:
Do I use
for all adverts, or would I have to have
,
,
etc for ads 1,2 and 3?
What html would I have for a blank image? Bit confused on that one!
Do I put the second section of code just before the tag?
My banners are javascript based. Would that still work with this?
Looking forward to hearing what you say! Big thank you!
Yes, first is render the forum, then after is render the ads.
The total time to render fullpage is the same (or similar).
You can/may one div for each ads.
You must replace the ads with something to occupy the same size, so that everything is displayed in the same place.
Otherwise the page flick (move during loading, sorry i don’t know the correct term)
For example: Replace
I think it’s possible that your pages there is some js error or other conflict, then don’t load the last (I don’t know sure)
Another issue, you must put one, and only one, window.onload
Pmeenan, I think don’t violate the TOS, nor iframe, nor ajax, nor modify code … but is a very good question.