Skip to main content
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 with fetchpriority="high", and lazy-load only off-screen media.
  • Prevent Cumulative Layout Shift (CLS): Always reserve dimensions with explicit width/height attributes or CSS aspect-ratio so deferred images do not push content down as they arrive.
  • Pre-trigger with IntersectionObserver margins: For custom widgets or charts, set a rootMargin (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() / dynamic import() so heavy chart or editor bundles load only when opened.