2.5 C
New York
Tuesday, March 19, 2024

Buy now

spot_img

Google Chrome Will Soon Support Lazy Loading at the Browser-Level

Google is adding support for native lazy loading to the latest version of the Chrome browser – Chrome 76.

In an announcement, the company states:

“Starting with Chrome 76, you’ll be able to use the new loading attribute to lazy-load resources without the need to write custom lazy-loading code or use a separate JavaScript library.”

Lazy loading delays the loading of  below-the-fold images until the user begins scrolling closer to them.

The end result is faster load times, minimized bandwidth for users, and reduced memory usage.

Previously, in order to take advantage of lazy loading, developers either had to use the Intersection Observer API or implement complicated event handlers.

Now, with lazy loading supported directly within Chrome, developers can add a simple ‘loading’ attribute when embedding images.

Here’s what the code looks when adding the loading attribute to an image and an iframe:

Google Chrome Will Soon Support Lazy Loading at the Browser-Level

You don’t even need the expertise of a developer to implement the loading attribute, as long as you have some basic knowledge of HTML. This makes lazy loading accessible to many more site owners.

The loading attribute supports the following values:

  • auto: Default lazy-loading behavior of the browser, which is the same as not including the attribute.
  • lazy: Defer loading of the resource until it reaches a calculated distance from the viewport.
  • eager: Load the resource immediately, regardless of where it’s located on the page.

This feature will continue to be updated until the stable version of Chrome 76 is released.

The old method of implementing lazy loading via JavaScript is still required for browsers that do not support the new ‘loading’ attribute.





Source link

0 0 votes
Article Rating
SEO News
SEO News
Search engine optimization (SEO) is the process of increasing the quality and quantity of website traffic by increasing visibility of a website or a web page to users of a web search engine.

Related Articles

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Stay Connected

0FansLike
3,912FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

Latest Articles