Re: [whatwg/fetch] New Proposal: Fetch retry (Issue #1838)

rakina left a comment (whatwg/fetch#1838)

Thanks all!

> To mitigate that risk, should there be a cap on how long (wall clock time) a retry will be attempted? And/or should it only attempt a retry if it looks like it's still on the same network interface, proxy configuration, and/or other networking configuration?
> I do see the explainer notes that there should be some browser-enforced limit on maxAge, but it's coming from a resource exhaustion angle vs. an info leak. Is there a proposed recommended limit?

Having reasonable limits sounds good to me. I randomly picked [1 day](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/loader/keep_alive_url_loader.cc;l=62;drc=d1a7d102945785a375d019b91994e704b2c8c7b6) in the prototype impl in Chromium, but that is likely too long. Perhaps a few hours is more reasonable? FWIW, the max attempt counts (per fetch, document, and network isolation key) will also be quite low so hopefully that helps?

For not retrying when changing the network though, actually one of the motivating use cases here is when e.g. a user switches from mobile to wifi network due to getting out of range for a bit. So we do want to retry in this case, which is quite common. Maybe limiting the number of network changes might be an option (since it's less likely to happen multiple times across valid retry cases)

> What happens if fetch returns a network error due to a policy?

The plan is to only retry if it's likely caused by an "intermittent network error", which I guess is a little hard to spec. So e.g. we will retry when we get DNS failures, the network changed like mentioned above, a connection can't be established etc. I think for policy errors we can tell that they're likely not intermittent? At least in Chromium we can differentiate them with error codes, e.g. here's the [list](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/loader/keep_alive_url_loader.cc;l=204;drc=d1a7d102945785a375d019b91994e704b2c8c7b6) we used for the prototype.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1838#issuecomment-3019346635
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/fetch/issues/1838/3019346635@github.com>

Received on Monday, 30 June 2025 14:18:59 UTC