Wydajność
perf/large-image
An image file in the source stays under the image budget (250 KB by default); larger ones are resized or re-encoded.
umiarkowanastatycznefe-images
Dlaczego
Images are usually the heaviest part of a page and often its Largest Contentful Paint element. A multi-megabyte photo costs mobile users time and data. The 250 KB budget is this tool's default, not a number from a standard; set audit.budgets.imageKB in the profile to change it.
Poprawka
Resize the image to the largest size it is displayed at (and provide smaller ones with srcset), and encode it as AVIF or WebP at a sensible quality. Framework image components and build plugins can do both at build time.
Przykłady
bad: public/hero.png 2.4 MB, 4000×3000, shown at 1200×900
good: public/hero.avif 140 KB, 1200×900, with 600w and 900w variants in srcsetŹródła
Fakty
- Identyfikator
perf/large-image- Waga
- umiarkowana
- Sprawdzanie
- statyczne sprawdzane w kodzie źródłowym przez
audit - Dotyczy plików
project- Ten sam problem w
- Lighthouse
image-delivery-insight - Uczy jej skill
fe-imagesImages and media delivery- Od wersji
- 0.1.0
Przeczytaj w terminalu
npx github:dawidolko/frontend-skills explain perf/large-image