Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Difference between preloading images and lazy loading images Reply To: Difference between preloading images and lazy loading images

#240760
Shikkediel
Participant

When we talk about preloading here, it actually means that the images get downloaded into the cache of the browser, right?

Yes, I insert the complete HTML instead of using new Image(). This will also make sure there are no unnecessary request when the images were previously cached.

to have a loading animation while still having critical “above the fold” CSS show up fast while the rest loads.

This is trickier than it seems when you take a cached scroll position into account. Although there is only a small chance that images are not cached in that case. Happens with Opera though which is very stubborn with this.

Or do you also actually load the few images and graphics/GIFs/etc that might be on page 1, 2 and 4 as well and only then “open” the site to the user?

No but I do try to share resources. So if the visitor goes to another page, I take advantage of cached items. Whether images (identical file paths among pages) or scripts (local storage).