The blurred placeholder that cost five seconds

An image preview that could never appear kept the browser busy for five seconds on the home page.

Engineering
Performance
NP–88 · Engineering

Next.js can show a blurred preview while an image loads. You give it a tiny image as data; it scales and blurs it, and the real image fades in on top.

Our components passed the image’s web address instead of the image data. The browser can’t fetch an address from inside that blur, so the preview never appeared. It still painted the blur filter, at full size, for every image on the page.

What it cost

On a simulated mobile load of the home page, the browser’s main thread spent 5.1 seconds on that painting. With the placeholders gone it spends 0.3 seconds. Nothing visible changed, because the preview had never shown.

What stayed

To bring blurred previews back, generate the tiny image when the file is uploaded and send it as data. An address won’t do.