html
html copied to clipboard
Should "list of available images" also cache broken image responses?
Porting from https://www.w3.org/Bugs/Public/show_bug.cgi?id=25798.
We need web platform tests, and potentially a spec change, to see how many fetches get made in the following scenario:
- An image is fetched, but comes back broken (network error etc.)
- After that fetch completes, another
<img>
for the same URL is inserted into the document
Do browsers try to fetch again? Or do they just immediately give back the broken image?
The existence of https://www.w3.org/Bugs/Public/show_bug.cgi?id=26068 and https://bugzilla.mozilla.org/show_bug.cgi?id=528448 indicates that they do cache such broken images and immediately fire onerror again. So likely closing this just requires writing tests. Let's be sure to include the onerror recursion test case mentioned in that bug (with some limit like 100 retries).
If it's web compatible it seems nice to break the onerror recusion at least if src
is set to the same value as the previous value.