html icon indicating copy to clipboard operation
html copied to clipboard

Should "list of available images" also cache broken image responses?

Open domenic opened this issue 5 years ago • 2 comments

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?

domenic avatar Mar 29 '19 20:03 domenic

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).

domenic avatar Mar 29 '19 21:03 domenic

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.

zcorpan avatar Jul 04 '22 12:07 zcorpan