Skip to content

Instantly share code, notes, and snippets.

View yjaaidi's full-sized avatar
💭
👨🏻‍🍳 helping you cook better apps

Younes Jaaidi yjaaidi

💭
👨🏻‍🍳 helping you cook better apps
View GitHub Profile
@yjaaidi
yjaaidi / prerender-clean-up.js
Last active February 1, 2022 17:01 — forked from imevro/gist:edfe9dea12196056467f
Clean up all cached pages in prerender.io from console
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: {