Cache Busters

This article describes why macros like ${timestamp} and ${random} are used and how they work.

What are Cache Busters?

Cache busters are methods to stop browsers from caching tracking URLs. They are an important and necessary part of the Ooyala ad serving workflow. The cache buster is often a random number attached at the end of a URL. Ooyala offers macros that can automatically add this random number to all requests sent from our backend.

About Ad Requests

The Ooyala Pulse ad server delivers ads to the right place and at the right time according to a set of rules. To be able to make a decision to deliver an ad, Pulse needs to receive an ad request. This request is sent from your player at the site (mobile, PC, tablet, ...) where you want ads to be delivered, and results in Pulse responding with an ad, according to the bookings and rules you have previously set up in Pulse.

Besides sending the ad itself, it also sends a variety of tracking links, click links, impression links, quartile links, and so on. Your ad player then automatically “clicks” at these links without the viewer ever noticing anything. This results in the ad server (or your 3rd party supplier of the tracking URL) registering an impression and other miscellaneous data, which it then presents through Pulse. These links are unique for every booked ad, and can therefore be used to gather statistics regarding impressions and so on. This information is then used for reporting or showing statistics on the dashboard.

Sometimes there are obstacles for the requests going back and forth between your ad player and the Ooyala Pulse ad server. Ad blockers are one source of failure for these ad requests.

Using Macros for “Cache Busting”

A problem that we actually can solve is “browser caching”. Browser caching is a function built into all browsers. It keeps a small copy of the latest used links, images, javascripts, which the user has loaded during their surfing, on the local hard drive on the user's computer. The reason for this is really in the best interest of the user. By loading stuff that is often used, directly from the hard drive, the user can load pages much faster and gets a better experience surfing the web.

However, this behavior results in your ad request also getting “cached”. This means that instead of reloading a unique tracking link that is used to count a new impression, we get an old saved link from the hard drive. This messes up the counted statistics in Pulse because the link is not unique.

To solve this, we introduce the concept of a “cache buster”. The trick is to add a unique number to the link. That way the browser will never have an old version of a link that matches the new one and therefore will not use a cached link.

This unique number can be a random sequence of figures or a detailed time stamp from our ad server that will also always be unique. To add these cache busting numbers dynamically to the trackers, we have the macros ${timestamp} and ${random}. When the ad player calls for an ad and the tracker links, the ${random} part of the booked tracking URL is replaced by a random number by Ooyala.

Example

The booked tracker http://mytrackerlink.com&${random} will become http://mytrackerlink.com&7494652826411 when it reaches the ad player, and the browser will therefore not load a cached version because the link is unique.

In short, the macros make the tracking links unique to avoid browser caching and resulting problems with statistics.

Was this article helpful?