• Resolved kayakfishingaddict

    (@kayakfishingaddict)


    I just started using WordPress for my blog and I’m finding really nice plugins for Ad serving (Ad Rotator, Advanced Ads) and even some interesting Ad Servers (adPlugg). I’m trying out the ad serving plugins (not ad server) right now and my site is using LiteSpeed. I’m noticing that Ads aren’t rotating unless the page is rendered from the server and not served out of cache. Is there a way to fix this? Can ESI be used to “punch holes” in the page and significantly reduce the TTL of the Ad portion(s) of the page? If so, any pointers to how I can do this or will it require the plugin developer to get involved? Right now Advanced Ads is the plugin I’m leaning toward.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there, I saw the mention and can address how AdPlugg handles it.

    AdPlugg allows your pages to be served out of cache by default. With AdPlugg, all of the ads are retrieved and rendered asynchronously in the browser using JavaScript. This makes it so that you can easily serve your pages out of cache while still applying logic and rotation to your ads.

    Take a look at any large site: these days all their ads are being served using JavaScript and an ad server – caching and site performance are a couple of the big reasons why.

    I haven’t seen ESI used for ads before but it should be possible. Serving the ads via JavaScript or using an iFrame are a lot more common solutions and would likely be a lot easier to implement.

    Thread Starter kayakfishingaddict

    (@kayakfishingaddict)

    Yep, I knew about that and listed adPlugg as one of those interesting solutions I may look into. I’m just wondering how it would work with ESI and if that technology would essentially allow WordPress itself to imitate an ad server by allowing the TTL to be set independently.

    Thread Starter kayakfishingaddict

    (@kayakfishingaddict)

    Ok, I’ve come back to answer my own question after researching LiteSpeed ESI. The answer is, YES ESI can be used to do this. And, even better, it’s super easy to do it!

    SOLUTION
    ESI has a shortcode method for identifying something as being enabled for ESI! You can read about that here:

    Turning WordPress Shortcodes into ESI Blocks

    So, for Advanced Ads, Ad Rotator, etc., you can essentially have that port of the page render with a different TTL than the rest of the page. Just modify the shortcode specification with three things:

    1. esi – make that the shortcode identifier at the beginning of the shortcode
    2. cache – you can specify public | private depending on the cache you’re targeting. For Ads that aren’t targeted you can choose public. Otherwise you can choose private if it’s for that specific user. The default is public.
    3. ttl – you can specify a ttl in seconds if that block should have a different ttl than the page; the default is the ttl of that page.

    So, if you use shortcodes like this to identify spots for an AD:
    [the_ad_placement id=”between-posts-leaderboard-728×90″]

    You can modify the caching of this block to make it never cache, and thus always render ad rotations because the php wordpress code is hit for the block every time, like this:
    [esi the_ad_placement id=”between-posts-leaderboard-728×90″ cache=”public” ttl=”0″]

    Pretty easy and it seems to work well although I’m not sure of the performance hit.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Ad Serving Plug-ins, LiteSpeed, & ESI’ is closed to new replies.