Last active
August 29, 2015 14:15
-
-
Save commuterjoy/d1667ff41c86af55670f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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