O'Reilly logo

ASP.NET Site Performance Secrets by Matt Perdeck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Improving ad loading

If you use an ad network such as DoubleClick or Google AdWords, they will have given you code to place on your pages along the following lines:

<script src= http://adserver.js?..... ></script>

This loads some JavaScript from the ad server, which then places the actual ad on your site. Easy.

Normally, this works fine. However, the ad server is slow at times. The problem is that while the browser is waiting for the ad server, it holds off rendering the page below the ad. If there is a long delay, this will not look good.

You could prevent this by loading the ads in iframes. However, this will prevent your ad slots from showing variable-sized ads. It also creates a big empty space on your page if the ad fails to load.

A neat way ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required