OpenX Blog

Faster page load times = happier users

by Arlen Coupland on December 30th, 2008

Hello everyone! Although it is The Holidays, the internet never sleeps. Instead, its more like a gentle snooze on the couch while holiday movies play in the background. This might be a good time to take advantage of the Big Snooze as people like to call it (or they soon will, because everyone follows my lead) and to update your copies of OpenX (or start using OpenX Hosted with the OpenX Market!) and to make sure your site is optimised and using the best invocation tag type for your needs! Yaaaaaay!

The subject for today pertains to the different types of tags you have in OpenX for delivering banners and how they relate to speed. Also included is a worked example of how to invocate your banners at the bottom of your pages and then re-position them once content has loaded.

First, lets try and clear up the types of invocation tags:

Please read the full comparison of invocation tags.

OpenX provides Image, Javascript, iFrame, XML-RPC, Local Mode and Single Page Call invocation tags. There’s choices a-plenty, as you can see. But don’t let this confuse you!

An Image tag is the barebone basic - it requires a cookie and can only deliver image banners (not SWFs or other HTML).

Javascript and iFrame tags are probably the most commonly used and are very versatile. The iFrame tag has the benefit that the content is loaded separately to the rest of the site - so if the banner is slow to load, it won’t delay the rest of the page from loading. However an iFrame tag does not allow for blocking banners or campaigns from displaying more than once per page. Also, because of browser security limitations they can’t be resized dynamically - meaning expandable banners won’t work well here.

Single Page Call is basically the new Javascript tag, available in OpenX versions 2.6 and above. It allows you to place one javascript call in the head of your page, which will call all of your zones or whichever ones you define. Then, you simply mark in your page where you want the zones to be used. Make sure to read the tutorial, and pay special attention to the Named Zones feature. If you don’t name exactly which zones you want to use, it will invocate all zones for the website account being used whether those zones are being displayed or not.

XML-RPC and Local Mode tags are the advanced ones. They request the banner before the page is generated, which gives some interesting possibilities. XML-RPC also allows for greater flexibility with integrating banners in applications other than a standard HTML page, since all banner information is returned in XML. There are tutorials specific to these 2 tags because they are more complicated to implement: documentation index.

So what about speed?

Please keep in mind that there are different ways to define speed.  First off, obviously it is the name of a famous Emmy award-winning film (did it win an Emmy? If not an Emmy, it did win an award… in my heart).

But speed in terms of page loading is not simply defined by the size of the page (10kb versus 3mb) or even the time it takes to load (although both are important). It is largely based on how fast it appears to be. This is influenced by the full size and complete page load time, but if you take 2 pages which are both 88kb and take 88 seconds to load you might find yourself visiting both of them and thinking that websiteB loads much faster than websiteA. This is because websiteB is my website and I’ve built it so that all small-but-important content is allowed to load first, followed by larger-but-important media, followed by banners, and then followed by frivolous animated “Have-a-grrrrrreat-day” GIFs (with neat dancing tigers).

So now lets talk about the banner tags and how they will affect your page speed.

To start, if you are only displaying image banners then the Image tag is a great choice, naturally. And if you just want a single, non-rotating image banner then using a cookieless Image tag with an email zone is a great way to go. These are both very simplistic, but they get the job done for such requirements.

If your website is on the same server and domain as OpenX, and the website can execute PHP code, then using Local Mode is quite a speedy option as it simply requires including a PHP file and then calling a function to request the banner.

If you want your banners to load separately from your website, then using iFrame tags is recommended. However, remember that to some people iFrame tags may *look* slower simply because the rest of the page will load separately.

And finally, javascript gives a good combination of versatility and features. Single Page Call allows you to take advantage of this and adds a speedy delivery.

But wait - there’s more. You could place banners at the bottom of your HTML page (after all content) and then use javascript to reposition the banners. What this does is give the rest of the content higher priority and it will have a better chance of being loaded first.

To help with this, please see this worked example for End of Page delivery: eop-example.

Inside the zip file is an HTML page with 2 spots for banners, as well as some fascinating content. At the bottom of the page are 2 invocation tags as well as a call to a javascript function which will reposition the 2 banners to appear above where they are meant to. The javascript file can most likely be kept as-is.

What other things can you do to help speed?

Caching is important. OpenX has built-in caching which limits calls to the database - in a production environment you might want to increase the cache time used by your installation. You might also want to install a caching system for PHP on your server.

Keep in mind what 3rd parties you are using for banners. If you are using external image banners or 3rd party HTML banners, not only must OpenX deliver the banner but the 3rd party must then deliver the image/HTML. Sometimes such external sources can be slow to load and should be kept in mind when analyzing speed.

Also, using additional features will have a slight impact on speed, try not to use unnecessary targeting/delivery features for absolute best performance.

Well, it’s been a blast! (no pun intended… Get it? Speed.. movie with a bomb… a blast? Ok, so the pun was intended, it just wasn’t very good). Make sure to check out the previous Tips and Tricks and also let us know what tips you have for speedy-page-loading.

12 Comments »

  1. After dealing with one previous client and their advertising, I found sadly that they were using a nasty ‘page builder’ along with their hosting, which only allowed the input of code using the interface. It meant that the client only ever saw the pages loading a lot slower. This pre-dates the Single Page Call tag.

    But now, with more hosting options offering PHP caching assistance, it’s helping.

    That’s one area where dedicated hardware really needs to be a must if you are serving big. Shared hosting for all of the love I have for it, just doesn’t cut it traffic wise, but then if my ads are hosted on the same server as the page, at least it just looks like the server and not specifically the ads (because it isn’t).

    PS: Speed rocks, Speedo 2 sucks, Speedos are big here in Europe and for some reason I can’t stop thinking about the film Jumping Jack Flash.

    Comment by Jase — December 30, 2008 @ 9:56 pm

  2. Hi, please visit http://kenh14.vn, we use json to load banner in right banner column
    Best regards,
    dogiangnam

    Comment by dogiangnam — December 31, 2008 @ 5:45 am

  3. hi

    the main disadvantage of single call is that if the openx server goes down
    all websites using openx in such way seem DOWN (or better it wait timout time..)!

    we should find a more robust trick that is not page display blocking

    Comment by francesco — January 10, 2009 @ 8:18 am

  4. What the shit in my openx admin main page? I do not know any systems with this shit:

    Dashboard Error
    XML-RPC connection error (code: 800)

    System message: XML-RPC connection error

    The dashboard pulls information from a central server for some widgets. There are several things which can affect this.
    Your server may not have the the Curl extension enabled. You may need to install or enable the Curl extension, see here for more details.
    You should also check that your firewall isn’t blocking outbound connections.

    If this error repeats please describe your problem in detail and post it on the OpenX forum.

    Comment by Laurynas — March 26, 2009 @ 11:32 pm

  5. Hi Laurynas,

    The error you mention affects only the dashboard (home) tab. It could be that the curl or xml-rpc extensions are not enabled in PHP. Else, there may be a firewall preventing your server from making external ssl connections.

    There are also admin level option to disable the dashboard in the Global Settings->User Interface Settings

    - Arlen

    Comment by Arlen — March 27, 2009 @ 9:32 am

  6. Hello Arlen.

    Why not -
    (1) Create a blank ad container first. Eg:
    (2) Invocate the banner within another container at the end of page. Eg:
    (3) Through Javascript, set top.innerHTML = bottom.innerHTML

    Do you see any problems, or issues with this implementation? IMO, if this would work, then it is the simplest way to implement end of page ad calls; as element re-positioning within a page is one of the toughest activities in web development. Add to it the complexity of browser compatibility, and one has his hands full. :-)

    Thanks in advance.

    – Rithish.

    Comment by Rithish — June 3, 2009 @ 10:11 am

  7. [...] already, and you’re not happy with the results), don’t forget that the OpenX blog has three different articles that all relate to performance — these are definitely worth reading, [...]

    Pingback by Tip #16: Measure performance « OpenX Tips — June 15, 2009 @ 12:03 pm

  8. thanks for you.. nice good document!,

    Comment by Brandi Stricker — July 3, 2009 @ 5:25 am

  9. thanks for you.. nice good document!,

    Comment by Daniel Phillips — July 3, 2009 @ 5:26 am

  10. Great work …. Thanks for your ideas.,

    Comment by PAMELA CARRIZALES — July 3, 2009 @ 5:26 am

  11. great site. I love online games,

    Comment by Michael Shultz — July 3, 2009 @ 5:58 am

  12. cool, i will bookmark it,

    Comment by preciousgirl2010 — July 3, 2009 @ 5:58 am

RSS feed for comments on this post. TrackBack URL

Leave a comment