DEV Community

desgh white
desgh white

Posted on

Progressive Image Loading for Content-Heavy Landing Pages

A landing page with twenty high-resolution images above the fold loads in 8 seconds on a 4G connection. Users leave after 3. The fix is not fewer images — it is smarter loading.

Three layers

  1. Inline placeholder — a 20-byte SVG with the dominant colour, embedded as a data URI in the src attribute. Zero network cost.
  2. Low-quality image — a 1KB blurred JPEG loaded via srcset at a tiny width. Appears in ~200ms.
  3. Full image — the real file, loaded with loading="lazy" and fetchpriority set by viewport position.
<img
  src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='300'%3E%3Crect fill='%23b8860b' width='400' height='300'/%3E%3C/svg%3E"
  srcset="thumb-20w.jpg 20w, full-800w.jpg 800w"
  sizes="(max-width: 600px) 100vw, 50vw"
  loading="lazy"
  alt="Casino interior"
  width="800" height="600"
>
Enter fullscreen mode Exit fullscreen mode

LCP optimisation

The Largest Contentful Paint image should NOT be lazy-loaded. Add fetchpriority="high" and preload it:

<link rel="preload" as="image" href="hero-800w.jpg" fetchpriority="high">
Enter fullscreen mode Exit fullscreen mode

A media-rich site like play at casino pride that relies on visual impact for first impressions needs sub-2-second LCP — the placeholder-to-full swap should be imperceptible.

Format selection

Serve AVIF where supported (40% smaller than WebP), WebP as fallback, JPEG as final fallback. Use the <picture> element:

<picture>
  <source srcset="hero.avif" type="image/avif">
  <source srcset="hero.webp" type="image/webp">
  <img src="hero.jpg" alt="...">
</picture>
Enter fullscreen mode Exit fullscreen mode

Takeaway

Progressive loading is three separate problems: placeholder (instant), low-quality (fast), full (lazy). Solve each layer independently.

Top comments (0)