Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Last active August 29, 2015 14:15
Show Gist options
  • Save commuterjoy/d1667ff41c86af55670f to your computer and use it in GitHub Desktop.
Save commuterjoy/d1667ff41c86af55670f to your computer and use it in GitHub Desktop.
(function () {
var soak = function () {
// a list of URLs to test
var urls = [
'http://next.ft.com/uk' // TOOD - mappings between ft & next
];
urls.forEach(function (url) { console.log(url);
$.ajax({
url: url,
method: 'GET',
crossDomain: true, // www.ft -> next.ft
headers: {
'x-next-ftcom-soak': 'true' // will need to configure Vannish to let these users through
}
})
});
};
// don't do this if we are on an old browser
if (!Array.prototype.forEach) {
return;
}
// only run for 5% of traffic
if (Math.random() > 0.05) {
return;
}
setTimeout(soak, 5000);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment