Lazy Load VS infinite scrolling

2020-08-18 03:26发布

问题:

I thought Lazy Loading and infinite scrolling are same things, But today I heard that these are two different things. Is that true?

回答1:

Lazy loading refers to deferring loading of any kind of content until it becomes necessary. For example, on a long page, images which are not currently visible do not need to be loaded. Only when the user scrolls the page over or near them do they get fetched from the server.

Infinite scrolling refers to new content being loaded when the end of the page is reached, so the effect of an infinitely long page is created (mostly to avoid tedious paging).

So yes, they're different, but related.



回答2:

Infinite Scrolling is one of the methodology by which we can achieve Lazy Loading.

Lazy loading means the request for the resource or records will be made only when they are demanded.

In case of Infnite Scrolling ,the request for the next set of records will be made only when scroll bar reaches bottom of th grid and fires request to load the next set of records.

So,well you can consider Infinite Scrolling is the technique by which Lazy loading is achieved.

Note: Infinite scrolling is not only the way to achieve Lazy Loading. there are many other ways of achieveing it. For ex: Demand Paging

Hope this helps..Thanks