What will occur if user cancel the resquest?

If the browser cancel a request, after it reach my Worker, my code:
" await promise.all([…]) "

Will be executed, or will be aborted?

The behaviour is undefined. fetch's init accepts a signal field which makes use of AbortController but AFAIK Cloudflare doesn’t hand you such a controller to detect request termination.

I suppose it would reap dangling invocations as soon as possible unless waitUntil is used. But how much is that “as soon as possible” is not defined.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.