118 images on one page: what lazy loading bought me, and the 2.4 MB I left on the table
Our products page is a catalog. Not a landing page with three hero shots - an actual catalog, one card per fabric line, each card carrying a hero image, a colour card, and a detail shot.
Deduplicated, it renders 118 images in a single document that weighs 177 KB before a single pixel loads. The pipeline on this page was patched incrementally over months, one batch at a time. This week I finally ran the numbers properly instead of trusting the mental model. Some of it holds up. Some of it doesn't.
Here is the audit, including the parts that make me look bad.
What the page actually contains
Measured on the live document, not from memory:
- 122
<img>elements, 118 unique sources - 77 unique
.webp, 41 unique.jpg loading="lazy"on 120 of 122 elementswidthandheightpresent on 122 of 122srcseton zerodecoding="async"on zero
That last pair is the whole story.
The part that worked
Lazy loading coverage is 98%. Two images load eagerly: the site logo and the first card's hero image. That is deliberate and correct - everything below the fold waits. Getting from "everything eager" to this was a one-line change per image and it was the single biggest win I have made to this page.
Dimensions are on every image. width and height attributes on all 122 elements means the browser reserves layout space before the image arrives. Cumulative Layout Shift on this page is zero, and it has been zero since the day I added the attributes. This is the cheapest performance fix that exists and it is still missing from an embarrassing number of production sites.
77 of 118 images are WebP. Conversion was done in batches over months, which is why it is not 118.
The part that didn't
41 JPEGs, averaging 185 KB. I sampled ten of them:
| Image | Size |
|---|---|
images/europe/e03_fabric.jpg |
259,858 B |
images/eyelet/e01.jpg |
210,235 B |
images/eyelet/e05.jpg |
209,644 B |
images/eyelet/e11.jpg |
199,258 B |
images/quilted/quilted_price.jpg |
195,114 B |
images/quilted/quilted_detail.jpg |
182,930 B |
images/eyelet/eyelet_hero.jpg |
182,892 B |
images/europe/e06_fabric.jpg |
165,811 B |
images/quilted/quilted_jacket.jpg |
144,765 B |
images/europe/e06_colors.jpg |
144,421 B |
Mean: 185.1 KB.
The ten WebP files I sampled average 127.1 KB, a ratio of 1.46. Convert the 41 remaining JPEGs at that ratio and the page drops 2.4 MB. That is the conservative number - the existing WebP files were mostly encoded from their own masters, not re-encoded from these specific JPEGs, so a fresh transcode at quality 80 would likely do better than 1.46.
I know this. I have known it since I converted the first batch. The reason 41 files are still JPEG is that they cluster in five MJ/MY product lines and three older collections, and I kept telling myself I would re-shoot those before converting them. Converting a file I am about to replace felt like wasted work. That reasoning has now cost more bandwidth than the re-shoot would have.
Zero srcset
This is the one that actually bothers me. Every image is served at one fixed width. A phone on a 390 px viewport downloads the same asset as a 4K desktop - and I measured the originals: they run 1,300 to 1,600 px wide. On a page with 118 images, that is not a rounding error - that is the dominant cost for mobile visitors, and mobile is where most first-time visitors arrive.
loading="lazy" and srcset solve different problems and people conflate them:
- Lazy loading decides whether to fetch. It stops below-the-fold images from competing with the first paint.
srcsetdecides what to fetch. It stops a phone from downloading a desktop-sized file.
I did the first and skipped the second, so every image that does get fetched is fetched at full size. Lazy loading made the page feel fast on my desktop. srcset is what would make it fast on a 3G connection in Jakarta.
Zero decoding="async"
Smaller, but free. Without it, image decoding can block the main thread during scroll. One attribute per image, no downside on modern browsers.
What I would do in what order
If I were starting this page again:
widthandheighton every image. Ten minutes, permanent CLS fix. Do it first.loading="lazy"on everything below the fold. One attribute. Biggest single win.srcsetwith three widths - 480, 960, 1600. This is the one I skipped and it is the one that matters most on mobile. Half a day for 118 images if you script the variant generation.decoding="async". Free.- Format conversion last. By the time you have
srcset, you are generating variants anyway, so emit WebP and AVIF at each width in the same pass. Doing format conversion first, like I did, means you convert the wrong sizes.
That ordering is the correction to what I actually did. I converted formats first, added lazy loading second, and never got to srcset at all.
The uncomfortable summary
- Lazy loading: 98% coverage. Done right.
- Layout stability: 100% coverage. Done right.
- Format: 65% WebP, 41 JPEGs at 185 KB average. Half done, 2.4 MB on the table.
- Responsive images: Not done at all.
- Async decoding: Not done at all.
Two out of five. The two I did are the two that are easiest to do, which is probably not a coincidence.
If you are auditing a catalog page of your own, the measurement is quick: count <img> elements, count how many lack srcset, and sample ten of the largest files. That tells you in five minutes where your megabytes are.
The page is mujiatextile.com/products.html if you want to view source and check my numbers. Full specs and spec sheets are there too - and yes, this post is also a backlink. I am not going to pretend otherwise.
Comments
No comments yet. Start the discussion.