alexb
02/20/2023, 10:01 PMworker routes
alexb
02/20/2023, 10:01 PMalexb
02/20/2023, 10:01 PMChaika
02/20/2023, 10:02 PMmydomain.com/*
in your routeChaika
02/20/2023, 10:03 PMjavascript
export default {
async fetch(request, env) {
var originResponse = await fetch(request);
if (originResponse.status == 530) {
return fetch("https://backupserver.mydomain.com/{usetheexistingpath, i'm too lazy to do this right for this example, but you could make a URL object off the request.url and change the hostname}")
}
return originResponse;
}
}
Or you can completely avoid requesting your origin by returning a response in your worker, etc.
Just keep in mind Workers execute before cache, so they will always execute for every requestalexb
02/20/2023, 10:08 PMgoshawk716
02/20/2023, 11:03 PMdave
02/20/2023, 11:03 PMwaitUntil
multiple times, will all of the promises be resolved before the Worker is killed, or only the last promise will be resolved for sure?James
02/20/2023, 11:05 PMPromise.allSettled
or similarSkye
02/20/2023, 11:07 PMdave
02/20/2023, 11:15 PMLind
02/21/2023, 2:05 AMUnsmart | Tech debt
02/21/2023, 2:05 AMLind
02/21/2023, 2:08 AMLind
02/21/2023, 2:08 AMKot
02/21/2023, 2:19 AMUnsmart | Tech debt
02/21/2023, 3:01 AMUnsmart | Tech debt
02/21/2023, 3:02 AMdave
02/21/2023, 5:42 AMdave
02/21/2023, 5:43 AMXevion
02/21/2023, 6:57 AMXevion
02/21/2023, 6:58 AMXevion
02/21/2023, 7:00 AMR2Bucket
.KAKAROT
02/21/2023, 7:38 AMkian
02/21/2023, 8:10 AMkian
02/21/2023, 8:11 AMXevion
02/21/2023, 8:20 AMResponse closed due to connection limit
? Seems like when I launch R2 PUT requests, doesn't seem to mind a bunch of parallel fetch callsHardAtWork
02/21/2023, 8:20 AMXevion
02/21/2023, 8:21 AMHardAtWork
02/21/2023, 8:21 AM