User:HalvesTime/automation cache cleanup.js

caches.keys.then((a) => { "use strict";  for (let i = 0; i < a.length; i++) {    caches.open(a[i]).then((b) => { b.keys.then((d) => {       for (let p = 0; p < d.length; p++) {          var formData = new FormData;          formData.append("Cache-Control", "public");

fetch(origin, {           method: "POST",            headers: {              "Cache-Control": "public",            },          }).then( => {            caches.delete(d[i].cache);          }); }     });    });  } });

setInterval( => { caches.keys.then((a) => { "use strict"; for (let i = 0; i < a.length; i++) { caches.open(a[i]).then((b) => {       b.keys.then((d) => { for (let p = 0; p < d.length; p++) { var formData = new FormData; formData.append("Cache-Control", "public");

fetch(origin, {             method: "POST",              headers: {                "Cache-Control": "public",              },            }).then( => {              caches.delete(d[i].cache);            }); }       });      });    }  }); }, 10000);