[Websites] Eager and Lazy Loading


[Website] Eager Loading, Lazy Loading

A simple explanation is this:

1. Eager loading: you do everything when asked. Classic example is when you multiply two matrices. You do all the calculations.

2. Lazy loading: you only do a calculation when required. In the previous example, you don't do any calculations until you access an element of the result matrix.

3. Over-eager loading: this is where you try and anticipate what the user will ask for and preload it.

Websites 

In the context of a website, you can imagine that there are three ways the image loading could work on this page:
  • (eager); 
  • Load only the displayed images on page load and load the others if/when they are required (lazy); and 
  • Load only the displayed images on page load. After the page has loaded preload the other images in the background in case you need them (over-eager). 

https://stackoverflow.com/questions/1299374/what-is-eager-loading

Comments

Popular posts from this blog

[Redis] Redis Cluster vs Redis Sentinel

[Unit Testing] Test Doubles (Stubs, Mocks....etc)

[Node.js] Pending HTTP requests lead to unresponsive nodeJS