With ever heavier and more complex websites, protocols like lazy loading are a gift from heaven – they allow sites to only download images and iframes the user sees, leaving out those that are out of view. While that has been possible through JavaScript libraries for years, native implementations should always be favored, since they're the least resource hungry. This is exactly what the Chrome team has been working on for the last year, with first hints in February and a test on Canary that started in August. Now, Google announced that it will enable it by default starting with Chrome 75 stable in May.

The feature works just as you would expect it to work. Images and iframes below the fold of a page will only be loaded if the user scrolls near them, with the exact moment of the load-in depending on factors such as the speed of the network. Most of the time, images and iframes should be loaded ahead of time and users shouldn't even notice the underlying mechanisms.

Website developers can adjust images' and iframes' behavior with a loading attribute, setting them to lazy, eager, and auto – with eager basically deactivating lazy loading for corresponding items.

While lazy loading was initially supposed to speed up browsing the mobile web on Android, it's now supported on all major platforms that allow the use of Google's Blink rendering engine: Windows, Mac, Linux, Chrome OS, Android, and Android WebView. Additionally, when you're using Chrome's data saver on Android, the feature will be even more aggressive: elements with loading="auto" or unset attributes will always only be downloaded when needed.

This could have implications on advertising – some ad iframes count impressions when they're loaded, not when the user views them, and those might end up with smaller numbers. However, website owners could always set their ads to loading="eager", defeating the purpose of Chrome's new feature, but allowing them to earn money.

Overall, this is a welcome change. We desperately need any and all improvements that speed up Chrome and make it use fewer resources. Lazy loading, in particular, might help make web browsing faster by 18 to 35 percent, according to tests in 2018.

You've been able to use the feature for quite a while already: Just head to chrome://flags and search for lazy. You have to activate both flags you'll find and restart the browser. I tested this myself, but I couldn't notice a substantial change in the way websites were represented – which is a good sign, since everything is supposed to happen off-screen.

https://play.google.com/store/apps/details?id=com.android.chrome

Source: Google, Addy Osmani

Via: Techdows