DEV Community

Discussion on: Loading Images with Web Workers

Collapse
 
andreigheorghiu profile image
Andrei Gheorghiu

Your claims are false.
They demonstrate two things: a) you haven't looked at the source code; b) you haven't actually tested your claims.

Image loading does not block rendering. It's as simple as that. If they do block anything, they block other images from loading.

In short: when the browser has to load more resources than its current limit of concurrent requests (which is 4-6 for most of the common browsers), it does its best at prioritizing based on resource type and its position in page (it will always try to render the elements currently on screen first (and it's not always the "above the fold": if you're scrolled down and refresh, it will actually prioritize the elements visible at exactly your current scroll). The main point is that images are almost in all cases the last in the list of priorities. So, if image loading does block something, it blocks other images from loading).

But they don't block rendering or JavaScript execution. Ever.