Lazy loading
Lazy loading (also known as asynchronous loading) is a technique used in computer programming, especially web design and web development, to defer initialization of an object until it is needed.[src] It can contribute to efficiency in the program's operation if properly and appropriately used.[src] This makes it ideal in use cases where network content is accessed and initialization times are to be kept at a minimum, such as in the case of web pages.[src] For example, deferring loading of images on a web page until they are needed for viewing can make the initial display of the web page faster.[src] The opposite of lazy loading is eager loading.[src]
Lazy loading (also known as asynchronous loading) is a technique used in computer programming, especially web design and web development, to defer initialization of an object until it is needed.[src] It can contribute to efficiency in the program's operation if properly and appropriately used.[src] This makes it ideal in use cases where network content is accessed and initialization times are to be kept at a minimum, such as in the case of web pages.[src] For example, deferring loading of images on a web page until they are needed for viewing can make the initial display of the web page faster.[src] The opposite of lazy loading is eager loading.[src] @NgModule({ imports: [ BrowserModule, RouterModule.forRoot([ {path: , component: HomeComponent}, {path: 'product', component: ProductDetailComponent}, {path: 'luxury', loadChildren: () => import('./luxury.module').then(m => m.LuxuryModule), data: {preloadme: true} } ] // , {preloadingStrategy: CustomPreloadingStrategy} ) ], declarations: [ AppComponent, HomeComponent, ProductDetailComponent], providers:[{provide: LocationStrategy, useClass: HashLocationStrategy}, CustomPreloadingStrategy], bootstrap: [ AppComponent ] }) private int _myWidgetID; private Widget _myWidget = null; public Widget MyWidget { get { if (_myWidget == null) { _myWidget = Widget.Load(_myWidgetID); } return _myWidget; } } Or alternatively, with the null-coalescing assignment operator ??= private int _myWidgetID; private Widget _myWidget = null; public Widget MyWidget { get => _myWidget ??= Widget.Load(_myWidgetID); } This method is the simplest to implement, although if null is a legitimate return value, it may be necessary to use a placeholder object to signal that it has not been initialized.[src] If this method is used in a multithreaded application, synchronization must be used to avoid race conditions.[src] $userData = array ( "UID" = > uniqid(), "requestTime" => microtime(true), "dataType" => "", "request" => "" ); if (isset($_POST['data']) && $userData) { // ...[src] } private ValueHolder valueHolder; public Widget MyWidget => valueHolder.GetValue(); ==External links== Lazy Loading, Mozilla Developer Network URLs, WHATWG HTML Standard JS Lazy Loading[src]
14 sentences · 14 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Lazy loading." encyclopegia.org, 2025, https://encyclopegia.org/wiki/lazy-loading. Accessed 25 November 2026.
Chicago
"Lazy loading." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/lazy-loading.
APA
encyclopegia.org. (2025). Lazy loading. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/lazy-loading
Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON