liveBook · Manning

Lazy initialization

As explained in The Art of Code

A resource-loading technique that defers retrieval until a resource is likely to be needed.

For page resources, lazy initialization delays retrieving images, video, or other assets until they are needed. For example, an image near the bottom of a long page can wait until the user scrolls toward it, reducing transferred data and network traffic. section 8.4.4

How The Art of Code covers it

How deep it goes
Describes the goal and a scrolling example without specifying an implementation.
Examples
Uses images near the bottom of a long page as assets that can wait until the user scrolls toward them.
What you can do after
Apply it by delaying retrieval of images, video, and other assets until they are needed.
How it connects
Connects static assets with bandwidth use, network conditions, and device capabilities.

Also explained in

Compare how 5 books explain lazy initialization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of Code. The section links point to the parts of the book it draws on.