Skip to content

perf(images): right-size next/image sizes across all pages and shared components#18128

Merged
wackerow merged 4 commits into
devfrom
perf/homepage-image-delivery
May 11, 2026
Merged

perf(images): right-size next/image sizes across all pages and shared components#18128
wackerow merged 4 commits into
devfrom
perf/homepage-image-delivery

Conversation

@pettinarip
Copy link
Copy Markdown
Member

@pettinarip pettinarip commented May 5, 2026

Summary

Extends the `next/image` `sizes` right-sizing discipline from the homepage to every App Router page on the site — 47 routes audited, 28 with fixes, ~45 total `` fixes across 30+ files.

The biggest wins are on shared components used site-wide: `CalloutSSR` (the single highest-leverage fix — was shipping intrinsic-sized PNGs for a 263px-capped container, 7–15× oversize on every page it appears), plus `HubHero`, `ContentHero`, `PageHero`, `CalloutBannerSSR`, `DataProductCard`, `ParallaxImage`, and `AssetDownloadImage`.

What changed

Shared components (highest leverage)

Component Fix
src/components/CalloutSSR.tsx Added sizes="263px" — was fetching 2000–4000px intrinsic for a 263px-capped container (7–15× oversize). Used on /community, /gas, /staking, /wallets, and MDX layouts.
src/components/CalloutBannerSSR.tsx Added sizes="(max-width: 991px) calc(100vw - 128px), 600px"
src/components/DataProductCard.tsx Added sizes="(max-width: 479px) 311px, 372px" matching CSS max-w-[311px] sm:max-w-[372px]
src/components/Hero/HubHero/index.tsx Simplified stale (max-width: 1504px) 100vw, 1504px100vw (true full-bleed)
src/components/Hero/ContentHero/index.tsx Added 50vw arm between lg and 2xl
src/components/PageHero.tsx Refined mobile arm; removed stale TODO comment
src/components/Image/ParallaxImage/index.tsx Fixed prop forwarding — was silently dropping all props except src/alt/className despite NextImageProps type declaration. Added ...props spread.
src/components/AssetDownload/AssetDownloadImage.tsx Added responsive sizes for the 3–4 column grid layout

Pages with fixes

Page Fix summary
/ SavingsCarousel, TrustLogos (earlier commits on this branch)
/10years TenYearHero background, AdoptionSwiper, InnovationSwiper, desktop adoption card
/apps AppsHighlight.tsx fill image missing sizes
/assets AssetDownloadImage grid slots + hero diamond image
/collectibles Badge images — missing mobile breakpoint
/community 4 feature images + EventCard highlight
/community/events EventCard
/contributing/translation-program/acknowledgements Certificate image (max-w-[800px] content)
/contributing/translation-program/translatathon (MDX layout) 3 portrait images with fixed pixel sizes
/developers dogeImage missing sizes
/gas walletImg (desktop-only) — 1px mobile arm to prevent fetch on hidden mobile image
/layer-2/learn WhatIsEthereumImage — 1552w intrinsic for ~432px slot
/learn LearnCard images — too small a value, corrected
/roadmap communityHeroImg, ethBlocksImage, ReleaseCarousel slides
/run-a-node 3 images — flat 624px → mobile-aware breakpoints
/stablecoins Coin images in token cards + DataProductCard banner + CalloutBannerSSR
/start ManDogeImage missing sizes
/trillion-dollar-security Report PDF thumbnail max-w-sm missing sizes
/use-cases UseCaseCard images
/videos VideoGalleryFilter — breakpoints misaligned (fixed sm/lg thresholds to match custom Tailwind config: sm=480, lg=992)
/wallets FindWalletImage (non-en locales) missing sizes
/what-is-ether 4 images all missing sizes (23×–15× oversize)

Pages already correct (no edits)

/apps/[application], /apps/categories, /bug-bounty, /community/events/conferences, /community/events/meetups, /community/events/search, /community/support, /developers/tools, /developers/tutorials, /ethereum-history-founder-and-ownership, /ethereum-vs-bitcoin, /get-eth, /layer-2, /layer-2/networks, /quizzes, /resources, /roadmap/_vision, /staking, /staking/deposit-contract, /what-is-ethereum, /what-is-the-ethereum-network, and more.

Why

Original Lighthouse mobile audit flagged "Improve image delivery" with ~200 KiB savings on the homepage. The same `sizes` discipline applied across the rest of the site removes the same class of oversize fetches on every other landing page. The biggest single fix is `CalloutSSR`, which appears on ~15 pages and was shipping multi-KB intrinsic images for a 263px-wide container.

Key implementation note: This project uses custom Tailwind breakpoints — sm=480px, md=768px, lg=992px (not 1024), xl=1280px, 2xl=1536px. All media queries in sizes attributes use these values.

Test plan

  • Walk through the pages listed above in DevTools → Network → verify _next/image?w=... URLs use smaller w= params appropriate to the rendered slot size.
  • Check /stablecoins, /community, /gas, /wallets — these use CalloutSSR or CalloutBannerSSR and should now fetch ~263px images instead of multi-KB intrinsic PNGs.
  • Verify hero images still render correctly on /layer-2, /staking, and other HubHero/ContentHero pages.
  • Re-run Lighthouse mobile to confirm "Improve image delivery" insight has shrunk across secondary landing pages.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 67b9d16
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/69fa58b5a9a57c00083b169d
😎 Deploy Preview https://deploy-preview-18128.ethereum.it
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 66 (🟢 up 1 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 98 (🔴 down 1 from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the config ⚙️ Changes to configuration files label May 5, 2026
@pettinarip pettinarip changed the title perf(homepage): right-size carousel and trust images perf(images): right-size next/image sizes across pages, adopt preload May 5, 2026
@pettinarip pettinarip force-pushed the perf/homepage-image-delivery branch from 0bf159e to 67b9d16 Compare May 5, 2026 20:53
@pettinarip pettinarip changed the title perf(images): right-size next/image sizes across pages, adopt preload perf(images): right-size next/image sizes across all pages and shared components May 5, 2026
Copy link
Copy Markdown
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checks out, looks good, thanks @pettinarip!

@wackerow wackerow merged commit cc56814 into dev May 11, 2026
10 checks passed
@wackerow wackerow deleted the perf/homepage-image-delivery branch May 11, 2026 15:50
@pettinarip pettinarip mentioned this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config ⚙️ Changes to configuration files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants