Skip to content

Instantly share code, notes, and snippets.

@gerardo-junior
Last active July 13, 2017 14:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerardo-junior/400f34795c8cedcdb1362519b6a3cb5f to your computer and use it in GitHub Desktop.
Save gerardo-junior/400f34795c8cedcdb1362519b6a3cb5f to your computer and use it in GitHub Desktop.
Clean up all cached pages in prerender.io (put in console)
var cleanUp = function() {
$.ajax({method: "GET", url: "https://prerender.io/api/cached-pages?page=0&pageSize=1000000"}).success(function(response) {
var total = response,
lastChecked = 1;
console.log("total: " + response.length);
for(var i = 0; i < total.length; i++) {
$.ajax({
method: "DELETE",
url: "https://prerender.io/api/remove-cached-url?url=" + encodeURIComponent (total[i].url)
}).done(function() {
console.log("good, " + (lastChecked + "/" + total.length))
})
}
})
}
cleanUp()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment