Web DevPerformance & OptimizationDiagramBeginner
Lazy Loading
KO: 지연 로딩 (Lazy Loading)·EN: Lazy Loading·JA: 遅延読み込み(Lazy Loading)
A performance pattern that defers loading off-screen images, media, or modules until they are actually needed by the user
Table of Contents
Structure Diagram
Eager Loading vs Lazy Loading Resource Timeline
Eager Load All2 steps
Lazy Loading3 steps
STEP 1Hero + 20 Off-screen Images(78ms)
Quick Answer
What is Lazy Loading?
A performance pattern that defers loading off-screen images, media, or modules until they are actually needed by the user. It is a core concept in Performance & Optimization within Web Dev.
Core Principles
Lazy loading defers downloading non-critical resources—such as below-the-fold images, iframes, and secondary UI widgets—until the user scrolls near them or triggers an interaction.
By reserving network bandwidth and main-thread decoding for above-the-fold content, lazy loading accelerates initial rendering and avoids wasting mobile data on assets the user may never view.
Practical Takeaways
- Never lazy-load the LCP hero image: Putting
loading="lazy"on the primary above-the-fold image delays its discovery until layout completes, hurting LCP. Mark hero images eager withfetchpriority="high", and lazy-load only off-screen media. - Prevent Cumulative Layout Shift (CLS): Always reserve dimensions with explicit
width/heightattributes or CSSaspect-ratioso deferred images do not push content down as they arrive. - Pre-trigger with
IntersectionObservermargins: For custom widgets or charts, set arootMargin(e.g.,200px) so loading starts just before the element enters the viewport.
Notable Examples
- E-commerce product grids and feeds: Load thumbnails progressively as shoppers scroll, cutting initial payload by megabytes.
- On-demand modals and rich editors: Combine
React.lazy()/ dynamicimport()so heavy chart or editor bundles load only when opened.