Intent to Prototype: Fetch retry (for keepalive fetches)

260 views
Skip to first unread message

Rakina Zata Amni

unread,
Jun 25, 2025, 3:01:43 AMJun 25
to blink-dev

Contact emails

rak...@chromium.org

Explainer

https://github.com/explainers-by-googlers/fetch-retry/tree/main

Specification

None

Design docs


https://docs.google.com/document/d/1C9lAn3tqXsrjxiid1qCC9qSL7jfA1PZdoo2lgL8L5Pw/edit?tab=t.0

Summary

Allow web developers to indicate that a fetch() request should be retried, to have a greater guarantee on it being reliably sent, even if the network is flaky. This is especially important for keepalive fetches, where the request might outlive the document, which can no longer watch for its failure and do manual retry. We intend to only support this for keepalive fetches for now because of implementation simplicity, and also the fact that all the use cases would benefit from being keepalive first.



Blink component

Blink>Loader

Motivation

fetch() requests can fail due to transient network errors. Manual JavaScript retries are complex and impossible to be done after page unload (e.g. for keepalive fetches), causing data loss for critical/high-value beacons. This proposal introduces a configurable, browser-managed retry mechanism within fetch(). It allows web developers to indicate that a fetch() request should be retried, to have a greater guarantee on it being reliably sent, even if the network is flaky.



Initial public proposal

https://github.com/WICG/proposals/issues/217

TAG review

None

TAG review status

Pending

Risks



Interoperability and Compatibility

None



Gecko: No signal

WebKit: No signal

Web developers: Positive
Internal/Google developers are interested in origin trial.

Other signals:

Security

Resource Exhaustion: Malicious or misconfigured sites could attempt to trigger excessive retries, potentially impacting network resources or target servers. Mitigation relies on browsers enforcing strict, reasonable limits on maxAttempts and maxAge, alongside implementing backoff delays. Information Leakage (Retry-Attempt Header): The proposed Retry-Attempt header explicitly reveals the retry state of a request to the target server and any intermediaries. While useful for debugging and server logic/deduplication, it does constitute information disclosure about the client's network behavior for that request, but the risk is likely low. Timing Attacks/Information Leakage: The timing patterns of retry attempts could theoretically leak some information about network conditions. This is unlikely to provide substantially more information than can already be inferred by observing standard network request timings and failures. Additionally the browser will add random delays/jitters as well. The risk is considered low.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Is this feature fully tested by web-platform-tests?

No

Flag name on about://flags



Finch feature name

FetchRetry

Requires code in //chrome?

False

Tracking bug

https://crbug.com/417930271

Estimated milestones

DevTrial on desktop138
DevTrial on Android138


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5181984581877760?gate=5075324035137536

This intent message was generated by Chrome Platform Status.

Ben Kelly

unread,
Jun 25, 2025, 9:22:07 AMJun 25
to Rakina Zata Amni, blink-dev
I'm just curious, is there a reason this is going through WICG instead of the WHATWG stages process?


Given its proposing to change the fetch spec, I would have thought it would be in that process.  Are there any past or ongoing discussions in fetch spec issues?

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACPC1r6QFoqcmdoEMeG4JKJXGLqvGW%2BMr-UZj%2Br6HrQ%3DTNqKYQ%40mail.gmail.com.

Rakina Zata Amni

unread,
Jun 26, 2025, 2:11:40 AMJun 26
to Ben Kelly, blink-dev, Domenic Denicola
Hi, there's no reason actually, it's just WICG is what I was familiar with and thought all proposals should go there, sorry for the confusion :)

So if we have to go with the WHATWG process, what would that require? Should I start a new issue in whatwg/fetch, or something else? Discussions on this feature have all been Google-internal (since the use cases came up internally), but we definitely want to discuss the feature externally too.

FWIW I've chatted with @Domenic Denicola about what parts of the Fetch spec would probably need to be changed for this, so we have some plans for the spec (although not actual PRs yet).

Domenic Denicola

unread,
Jun 26, 2025, 2:17:26 AMJun 26
to Rakina Zata Amni, Ben Kelly, blink-dev, Domenic Denicola
I think you should do whichever you prefer. We've found the WHATWG Stages process is most useful when the person driving the feature (you) wants to get strong community feedback on how well their proposal is advancing through the stages. But you can also add features to WHATWG specs "the usual way", by just posting a PR and bugging people for reviews and standards-positions and so on, without the forcing function of stage advancement.

Ben Kelly

unread,
Jun 26, 2025, 9:07:15 AMJun 26
to Domenic Denicola, Rakina Zata Amni, blink-dev
Thanks.  I guess I was most interested in seeing if Anne had a take on this yet, so I was just looking around for a fetch issue or something when this question occurred to me.

Rakina Zata Amni

unread,
Jun 27, 2025, 9:24:11 AMJun 27
to Ben Kelly, Domenic Denicola, blink-dev
Thanks, I've created an issue in whatwg/fetch for this proposal to get wider feedback on this. LMK if I need to do anything else!

Ben Kelly

unread,
Jun 27, 2025, 9:38:20 AMJun 27
to Rakina Zata Amni, Domenic Denicola, blink-dev
Thanks Rakina!
Reply all
Reply to author
Forward
0 new messages