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
const cleanUp = async () => { | |
const response = await fetch('https://prerender.io/api/cached-pages?page=0&pageSize=100'); | |
const itemList = await response.json(); | |
const csrfToken = document.cookie.replace(/^.*XSRF-TOKEN=/, '').replace(/;.*$/, ''); | |
const promiseList = itemList.map(item => fetch(`https://prerender.io/api/remove-cached-url?url=${encodeURIComponent(item.url)}`, { | |
method: 'DELETE', | |
headers: { |