-
-
Save pratham2003/c4bb4c3e94d951749f5e514f54e280b8 to your computer and use it in GitHub Desktop.
Clean up all cached pages in prerender.io from console
This file contains 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
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