Core Web Vitals: LCP, CLS və INP
Google-un Core Web Vitals göstəriciləri — LCP, CLS və INP — nəyi ölçür və necə qiymətləndirilir: hədlər, 75-ci persentil qaydası, onları real istifadəçilərdə və laboratoriyada ölçmək, həmçinin hər birini düzəltmək yolları.
Bu mövzu Junior səviyyəsindən başlayır.
Core Web Vitals nədir
Core Web Vitals Google-un hər səhifədə izləməyi tövsiyə etdiyi, istifadəçi təcrübəsinə əsaslanan üç göstəricidir. Hər biri istifadəçinin verə biləcəyi bir suala cavab verir:
- LCP — Largest Contentful Paint (yüklənmə): əsas məzmun artıq göründümü?
- INP — Interaction to Next Paint (reaksiya sürəti): klikləyəndə, toxunanda və ya yazanda səhifə tez reaksiya verirmi?
- CLS — Cumulative Layout Shift (vizual sabitlik): məzmun yerində qalırmı, yoxsa atlayır?
Hədlər
| Göstərici | Yaxşı | Təkmilləşdirilməlidir | Pis |
|---|---|---|---|
| LCP | ≤ 2,5 s | 2,5 s – 4 s | > 4 s |
| INP | ≤ 200 ms | 200 ms – 500 ms | > 500 ms |
| CLS | ≤ 0,1 | 0,1 – 0,25 | > 0,25 |
75-ci persentil qaydası
Göstərici bir ölçmə ilə və ya orta qiymətlə dəyərləndirilmir. Hər biri mobil və desktop üçün ayrılıqda, səhifə yükləmələrinin 75-ci persentilində qiymətləndirilir. Səhifə hər üç göstərici 75-ci persentildə "yaxşı" olanda keçmiş sayılır. Bu o deməkdir ki, hər göstərici üzrə ən azı dörd ziyarətdən üçündə təcrübə yaxşı olub. Persentil dayanıqlıdır: bir neçə ekstremal ziyarət nəticəni müəyyən etmir, istifadəçilərin ən yavaş dörddə biri isə müəyyən edir. Orta qiymət isə, əksinə, böyük bir istifadəçi qrupu əziyyət çəkəndə də yaxşı görünə bilər.
Göstəricilər toplusu necə dəyişir
Göstəricilər bir həyat dövründən keçir: experimental → pending → stable. Stabil Core Web Vitals ildə ən çoxu bir dəfə dəyişir. Son dəyişiklik 12 mart 2024 tarixində oldu: INP First Input Delay-i (FID) əvəz etdi. FID yalnız ilk qarşılıqlı əlaqənin handler-lərinin başlamasına qədərki gecikməni ölçürdü; INP isə hər qarşılıqlı əlaqəni və növbəti kadr çəkilənə qədər keçən bütün vaxtı əhatə edir.
Digər göstəricilər diaqnostika üçün faydalıdır, amma Core Web Vitals-a daxil deyil: Time to First Byte (TTFB), (FCP) və laboratoriyada Total Blocking Time (TBT).
Kritik render yolu ilə əlaqəsi
mövzusu brauzerin ilk render-dən əvvəl gördüyü işi izah edir. LCP həmin işin nəticəsini real istifadəçilərin məlumatlarında görmək üsuludur, CLS resurslar gələrkən layout-un sabit qalıb-qalmadığını göstərir, INP isə yükləmədən sonrakı hər şey haqqındadır: insanlar səhifədən istifadə etməyə başlayanda o, nə qədər tez cavab verir.
Core Web Vitals are three user-centred metrics that Google recommends tracking on every page. Each one answers a question a user would ask:
- LCP — Largest Contentful Paint (loading): has the main content appeared?
- INP — Interaction to Next Paint (responsiveness): does the page react quickly when I click, tap or type?
- CLS — Cumulative Layout Shift (visual stability): does the content stay where it is, or does it jump?
Thresholds
| Metric | Good | Needs improvement | Poor |
|---|---|---|---|
| LCP | ≤ 2.5 s | 2.5 s – 4 s | > 4 s |
| INP | ≤ 200 ms | 200 ms – 500 ms | > 500 ms |
| CLS | ≤ 0.1 | 0.1 – 0.25 | > 0.25 |
The 75th percentile rule
A metric is not judged by one measurement or by the average. Each is assessed at the 75th percentile of page loads, segmented into mobile and desktop. A page "passes" when all three are good at the 75th percentile, which means at least three out of four visits had a good experience on each metric. The percentile is robust: a few extreme visits do not decide the result, but a slow quarter of your users does. An average, in contrast, can look fine while a large group of users suffers.
How the set changes
Metrics go through a lifecycle: experimental → pending → stable, and stable Core Web Vitals change at most once per year. The last change was on March 12, 2024, when INP replaced First Input Delay (FID). FID measured only the delay before the first interaction's handlers could start; INP covers every interaction and the whole time until the next frame is painted.
Other metrics are useful for diagnosis but are not Core Web Vitals: Time to First Byte (TTFB), (FCP), and Total Blocking Time (TBT) in the lab.
How this relates to the critical rendering path
The topic explains what the browser does before the first render. LCP is how you see the result of that work in real users' data, CLS tells you whether the layout stayed stable while resources arrived, and INP is about everything after load: how fast the page responds once people start using it.
LCP: əsas məzmun nə vaxt görünür
viewport-da görünən ən böyük şəklin, mətn blokunun və ya videonun render vaxtını, səhifənin yüklənməyə başladığı andan hesablayaraq bildirir. İdeya sadədir: ilk ekrandakı ən böyük şey, çox güman ki, istifadəçinin gəldiyi şeydir — məhsulun şəkli, məqalənin başlığı, hero video.
Hansı elementlər nəzərə alınır
<img>elementləri və<svg>içindəki<image>elementləri;<video>elementləri (poster şəkli və ya ilk kadrı);url()ilə yüklənən fon şəkli olan elementlər (CSS gradient sayılmır);- içində mətn olan blok elementləri.
Chromium "məzmun" olma ehtimalı az olan elementləri də nəzərə almır: opacity: 0 olan elementləri, bütün viewport-u örtən elementləri (onlar fon sayılır) və entropiyası aşağı olan placeholder şəkillərini.
Bir ölçmə yox, namizədlər
Səhifə addım-addım render olunur, ona görə brauzer daha böyük element hər dəfə çəkiləndə yeni LCP namizədi bildirir: əvvəlcə, məsələn, başlıq, sonra yüklənib qurtaran hero şəkli. Sonuncu namizəd qalib gəlir. İstifadəçi səhifə ilə qarşılıqlı əlaqəyə girən kimi (toxunma, scroll və ya düymə basışı) brauzer yeni namizəd bildirməyi dayandırır, çünki bundan sonra istifadəçi artıq səhifədən istifadə edir.
Nəzərə alınan ölçü elementin viewport-da görünən hissəsidir: kəsilən və ya ilk ekrandan aşağıda qalan hissə sayılmır. Buna görə telefondakı LCP elementi çox vaxt desktop ekranındakından fərqli olur.
Brauzerdə görmək
new PerformanceObserver((list) => {
const entries = list.getEntries();
const last = entries[entries.length - 1];
console.log("LCP candidate", Math.round(last.startTime), last.element);
}).observe({ type: "largest-contentful-paint", buffered: true });buffered: true observer yaradılmazdan əvvəl qeydə alınmış entry-ləri də çatdırır. Bunu məhsul səhifəsinin konsolunda işlətsən, adətən iki-üç namizəd görəcəksən, sonuncusu da məhsulun əsas şəkli olacaq.
LCP-ni nə yavaşladır
Dörd tipik səbəb var: server gec cavab verir (ilk bayt gecikir), brauzer şəkli gec tapır (onu JavaScript əlavə edir və ya o, CSS-də gizlənib), şəkil çox ağırdır, ya da şəkil artıq gəlib, amma render-i CSS, JavaScript və ya uzun tapşırıq bloklayır. "LCP-nin düzəldilməsi" bölməsi LCP-ni bu dörd hissəyə bölür və hər biri üçün həlli göstərir.
reports the render time of the largest image, text block or video visible in the viewport, measured from the moment the page started loading. The idea: the biggest thing on the first screen is most likely what the user came for — the product photo, the article headline, the hero video.
Which elements count
<img>elements, and<image>elements inside an<svg>;<video>elements (their poster image or first frame);- elements with a background image loaded with
url()(a CSS gradient does not count); - block-level elements that contain text.
Chromium also ignores elements that are unlikely to be "content": elements with opacity: 0, elements that cover the whole viewport (treated as a background), and low-entropy placeholder images.
Candidates, not one measurement
The page renders in steps, so the browser reports a new LCP candidate every time a larger element is painted: first maybe the headline, then the hero image once it has loaded. The last candidate wins. The browser stops reporting new candidates as soon as the user interacts with the page (a tap, a scroll or a key press), because after that the user is already using the page.
The size that counts is the part visible in the viewport: whatever is clipped or below the fold does not count. That is why the LCP element on a phone is often different from the one on a desktop screen.
Seeing it in the browser
new PerformanceObserver((list) => {
const entries = list.getEntries();
const last = entries[entries.length - 1];
console.log("LCP candidate", Math.round(last.startTime), last.element);
}).observe({ type: "largest-contentful-paint", buffered: true });buffered: true also delivers the entries recorded before the observer was created. Run this in the console of a product page and you will usually see two or three candidates, ending with the main product photo.
What makes LCP slow
The four typical reasons: the server answers slowly (late first byte), the browser finds the image late (it is added by JavaScript or hidden in CSS), the image is too heavy, or the image has arrived but rendering is blocked by CSS, JavaScript or a long task. The "Fixing LCP" section breaks LCP into these four parts and shows the fix for each.
CLS: layout sürüşmələri və sessiya pəncərələri
"Səbətə əlavə et" düyməsinə toxunmaq üzrəsən və onun üstündə banner peyda olur: düymə aşağı tullanır, sən də başqa yerə toxunursan. Cumulative Layout Shift məhz bu cür gözlənilməz hərəkəti ölçür.
Layout sürüşməsi nədir
Görünən element iki kadr arasında başlanğıc mövqeyini dəyişəndə layout sürüşməsi baş verir. Yeni element əlavə etmək və ya elementin ölçüsünü dəyişmək özlüyündə sürüşmə deyil; o, başqa görünən elementləri yeni mövqeyə itələyəndə sürüşməyə çevrilir. Hər sürüşmə bal alır:
layout shift score = impact fraction × distance fraction- Impact fraction: qeyri-sabit elementlərin köhnə və yeni mövqeləri birlikdə viewport-un nə qədərini örtür.
- Distance fraction: onlar viewport-un böyük ölçüsünə nisbətən nə qədər yerini dəyişib.
web.dev-dən nümunə: element portret viewport-un yarısını tutur və viewport hündürlüyünün dörddə biri qədər aşağı sürüşür. Köhnə və yeni mövqelər birlikdə viewport-un 75%-ni örtür, ona görə impact fraction 0,75, distance fraction 0,25, bal isə 0,75 × 0,25 = 0,1875 olur. Belə tək bir sürüşmə artıq səhifəni "təkmilləşdirilməlidir" zonasına salır.
Nə sayılmır
- Gözlənilən sürüşmələr. Diskret istifadəçi girişindən (klik, toxunma, düymə basışı) sonrakı 500 ms ərzində baş verən sürüşmələr
hadRecentInputilə işarələnir və hesaba daxil edilmir: accordion-u açanda altındakı məzmunun tərpənməsi gözləniləndir. Scroll, sürükləmə və pinch-zoom isə yaxın vaxtdakı giriş sayılmır. - Transform-lar.
transform: translate()və yascale()animasiyası layout mövqelərini dəyişmədən pikselləri hərəkət etdirir, ona görə layout sürüşməsi deyil.topvə yaheightanimasiyası isə sürüşmədir.
Sessiya pəncərələri
CLS bütün ziyarət boyu baş verən sürüşmələrin cəmi deyil. Sürüşmələr sessiya pəncərələrinə qruplaşdırılır: hər sürüşmə əvvəlkindən 1 saniyədən az sonra gəldikcə pəncərə davam edir, pəncərənin uzunluğu isə ən çoxu 5 saniyədir. Səhifənin CLS-i onun ən pis pəncərəsinin balıdır. Buna görə uzun yaşayan single-page app bir-birindən uzaq çoxlu kiçik sürüşmələrə görə cəzalandırılmır, yüklənmə zamanı baş verən sürüşmə partlayışı isə tam sayılır.
Tipik səbəblər
Ölçüsü verilməmiş şəkillər və iframe-lər, yeri əvvəlcədən ayrılmamış reklam və embed-lər, mövcud məzmunun üstünə əlavə olunan məzmun (cookie bildirişləri, promo bannerlər, "bunlar da xoşuna gələ bilər" blokları), gələndə mətnin ölçüsünü dəyişən web şriftlər və layout xassələrinin animasiyası. "CLS-in düzəldilməsi" bölməsi onları bir-bir nəzərdən keçirir.
You are about to tap "Add to cart" and a banner appears above it: the button jumps down and you tap something else. Cumulative Layout Shift measures exactly this kind of unexpected movement.
What a layout shift is
A layout shift happens when a visible element changes its start position between two frames. Adding a new element or resizing one is not a shift by itself; it becomes one when it pushes other visible elements to a new position. Each shift gets a score:
layout shift score = impact fraction × distance fraction- Impact fraction: the part of the viewport covered by the unstable elements, counting both their old and new positions.
- Distance fraction: how far they moved, relative to the viewport's larger dimension.
Example from web.dev: an element covers half of a portrait viewport and moves down by a quarter of the viewport height. Old and new positions together cover 75% of the viewport, so the impact fraction is 0.75; the distance fraction is 0.25; the score is 0.75 × 0.25 = 0.1875. A single shift like that already makes the page "needs improvement".
What does not count
- Expected shifts. Shifts within 500 ms of a discrete user input (click, tap, key press) are flagged with
hadRecentInputand excluded: if you open an accordion, the content below is expected to move. Scrolling, dragging and pinch-zooming do not count as recent input. - Transforms. Animating
transform: translate()orscale()moves pixels without changing layout positions, so it is not a layout shift. Animatingtoporheightis.
Session windows
CLS is not the sum of all shifts over the whole visit. Shifts are grouped into session windows: a window continues while each shift comes less than 1 second after the previous one, and it lasts at most 5 seconds. The page's CLS is the score of its worst window. A long-lived single-page app therefore is not punished for many small, far-apart shifts, but a burst of shifts while the page loads still counts in full.
Typical causes
Images and iframes without dimensions, ads and embeds without reserved space, content inserted above existing content (cookie notices, promo banners, "you may also like" blocks), web fonts that change text size when they arrive, and animations of layout properties. The "Fixing CLS" section takes them one by one.
INP: qarşılıqlı əlaqənin nəticəsi nə qədər gec görünür
Interaction to Next Paint ziyarət boyu hər klik, toxunma və düymə basışını izləyir (hover və scroll INP üçün qarşılıqlı əlaqə sayılmır) və girişdən brauzerin növbəti kadrı göstərdiyi ana qədər, yəni istifadəçinin nəsə baş verdiyini görə bildiyi ana qədər keçən vaxtı ölçür.
Bir qarşılıqlı əlaqənin üç mərhələsi
input ──► handlers start ──► handlers end ──► next frame presented
└── input delay ──┘└─ processing ─┘└─ presentation delay ─┘- Input gecikməsi (input delay) — başqa işlə məşğuldur (uzun tapşırıq, taymer, hydration), ona görə hadisə handler-ləri hələ başlaya bilmir.
- Emal müddəti (processing duration) — qarşılıqlı əlaqənin bütün hadisə callback-ləri işləyir (
pointerdown,pointerup,clickvə yakeydown,keyupvə s.), üstəlik onların sinxron yaratdığı state yeniləmələri və render-lər. - Göstərilmə gecikməsi (presentation delay) — handler-lərdən sonra brauzer stili yenidən hesablayır, layout-u işlədir, paint edir və kadrı göstərir. Böyük DOM, layout thrashing və ya nəhəng
innerHTMLyeniləməsi bu mərhələni uzadır.
Qarşılıqlı əlaqələrdən bir rəqəmə
Səhifənin INP-si onun ən uzun qarşılıqlı əlaqəsidir, kənar qiymətlər nəzərə alınmadan: hər 50 qarşılıqlı əlaqədən ən yüksək biri atılır ki, məşğul səhifədəki bir uğursuz klik nəticəni müəyyən etməsin. İstifadəçilər üzrə INP də digərləri kimi 75-ci persentildə qiymətləndirilir: yaxşı ≤ 200 ms, pis > 500 ms. Heç bir klik, toxunma və ya düymə basışı olmayan ziyarətin ümumiyyətlə INP dəyəri olmur və bu, yaxşı dəyərlə eyni şey deyil.
FID niyə kifayət etmirdi
First Input Delay yalnız birinci mərhələni və yalnız ilk qarşılıqlı əlaqə üçün ölçürdü. Səhifənin FID-i mükəmməl ola bilərdi, sonrakı hər klikin nəticəsi isə handler-in özü yavaş olduğu üçün bir saniyəyə görünərdi. INP bütün qarşılıqlı əlaqələr üçün hər üç mərhələni əhatə edir; məhz buna görə mart 2024-də FID-in yerinə Core Web Vital oldu.
Altındakı brauzer API-si
INP Event Timing API üzərində qurulub. event tipli entry-lərin bir qarşılıqlı əlaqənin hadisələrini qruplaşdıran interactionId sahəsi var; susmaya görə yalnız 104 ms və daha uzun hadisələr bildirilir, durationThreshold isə bu həddi 16 ms-ə qədər endirə bilir:
new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
if (!entry.interactionId) continue;
const inputDelay = entry.processingStart - entry.startTime;
console.log(entry.name, Math.round(entry.duration), Math.round(inputDelay));
}
}).observe({ type: "event", durationThreshold: 16, buffered: true });Praktikada bunu nadir hallarda özün yazırsan; qruplaşdırmanı və kənar qiymət qaydalarını web-vitals kitabxanası sənin əvəzinə edir.
Interaction to Next Paint observes every click, tap and key press during the visit (hovering and scrolling are not interactions for INP) and measures how long it takes from the input until the browser presents the next frame, the moment the user can see that something happened.
Three phases of one interaction
input ──► handlers start ──► handlers end ──► next frame presented
└── input delay ──┘└─ processing ─┘└─ presentation delay ─┘- Input delay — the is busy with something else (a long task, a timer, hydration), so the event handlers cannot start yet.
- Processing duration — all event callbacks for the interaction run (
pointerdown,pointerup,click, orkeydown,keyup, and so on), plus whatever state updates and renders they trigger synchronously. - Presentation delay — after the handlers, the browser recalculates style, runs layout, paints and presents the frame. A large DOM, layout thrashing or a huge
innerHTMLupdate makes this long.
From interactions to one number
The page's INP is its longest interaction, ignoring outliers: for every 50 interactions, the single highest one is ignored, so one unlucky interaction on a busy page does not define it. Across users, INP is assessed like the others, at the 75th percentile: good ≤ 200 ms, poor > 500 ms. A visit without any click, tap or key press has no INP value at all, which is different from a good value.
Why FID was not enough
First Input Delay measured only phase 1, and only for the first interaction. A page could have a perfect FID while every later click took a second to render because the handler itself was slow. INP covers all three phases for all interactions, which is why it became a Core Web Vital instead of FID in March 2024.
The browser API underneath
INP is built on the Event Timing API. Entries of type event carry an interactionId that groups the events of one interaction; by default only events of 104 ms or longer are reported, and durationThreshold lowers that to as little as 16 ms:
new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
if (!entry.interactionId) continue;
const inputDelay = entry.processingStart - entry.startTime;
console.log(entry.name, Math.round(entry.duration), Math.round(inputDelay));
}
}).observe({ type: "event", durationThreshold: 16, buffered: true });In practice you rarely write this yourself; the web-vitals library does the grouping and outlier rules for you.
Ölçmə: field data və laboratoriya məlumatları
Field data (real user monitoring, RUM) real ziyarətlərdən gəlir: real cihazlar, şəbəkələr, cache-lər və qarşılıqlı əlaqələr. Laboratoriya məlumatları səhifəni idarə olunan mühitdə yükləməklə əldə olunur. Core Web Vitals field data üzərində müəyyən edilir; laboratoriya isə debug etdiyin yerdir.
Field data
- CrUX (Chrome UX Report) razılıq vermiş real Chrome istifadəçilərinin məlumatlarını sürüşən 28 günlük pəncərədə, origin üzrə, kifayət qədər trafik olanda isə URL üzrə toplayır. Onu PageSpeed Insights-da, Search Console-da və CrUX API-də görürsən. Pəncərə 28 gün olduğu üçün düzəliş CrUX-da tədricən görünür.
- Öz RUM-un, adətən Google-un
web-vitalskitabxanası ilə. O, rəsmi qaydaları (LCP namizədləri, CLS sessiya pəncərələri, INP kənar qiymətləri) tətbiq edir və CLS ilə INP-ni səhifə gizlənəndə göndərir, çünki onlar o vaxta qədər dəyişə bilər.
import { onCLS, onINP, onLCP } from "web-vitals/attribution";
function send(metric) {
const body = JSON.stringify({
name: metric.name,
value: metric.value,
rating: metric.rating,
id: metric.id,
attribution: metric.attribution,
});
navigator.sendBeacon("/analytics/vitals", body);
}
onLCP(send);
onCLS(send);
onINP(send);Attribution build-i "niyə" sualına cavab əlavə edir: LCP elementi və onun dörd alt hissəsi, ən çox sürüşən element, INP-nin hədəf elementi və üç mərhələsi. onFID web-vitals v5-də (2025) silindi; v6 (2026) soft navigation dəstəyi əlavə etdi.
RUM üçün brauzer dəstəyi vacibdir. largest-contentful-paint və Event Timing entry-ləri (INP-yə lazım olan interactionId ilə birlikdə) Chromium, Firefox və Safari 26.2+ brauzerlərində var, layout-shift isə yalnız Chromium-dadır, ona görə sənin CLS məlumatların yalnız Chromium istifadəçilərindən gəlir. CrUX-un özündə isə yalnız Chrome istifadəçiləri var.
Laboratoriya məlumatları
- Lighthouse səhifəni bir dəfə, emulyasiya olunmuş orta səviyyəli telefonda və məhdudlaşdırılmış şəbəkədə yükləyir. O, yüklənmə zamanı LCP və CLS-i göstərir, amma səhifə yükləməsində istifadəçi qarşılıqlı əlaqəsi olmadığı üçün INP əvəzinə onun proksisi kimi Total Blocking Time-ı göstərir.
- DevTools Performance paneli sən səhifədən istifadə edərkən canlı LCP, CLS və INP göstərir, onları CrUX ilə müqayisə edə bilir, Insights bölməsinə isə LCP breakdown, INP breakdown və Layout shift culprits daxildir.
İkisi niyə fərqlənir
Laboratoriya ölçmələri soyuq cache, bir sabit cihaz və viewport ilə aparılır və yüklənmə ilə bitir. Real istifadəçilərin isti cache-i, fərqli ekranları (deməli, fərqli LCP elementləri), fərdiləşdirilmiş məzmunu var, onlar scroll edir və klikləyir: field CLS yüklənmədən çox sonrakı sürüşmələri də əhatə edir, real INP isə yalnız field-də olur. Nəyi düzəltmək lazım olduğuna field data əsasında qərar ver, sonra problemi laboratoriyada təkrarla və yoxla.
Single-page app-lər xüsusi haldır: route dəyişikliyi "soft navigation"-dır. Chrome onları Chrome 151-dən bəri susmaya görə ölçür, CrUX isə onları experimental göstəricilər kimi bildirir; bu göstəricilərin may 2027-də stabil olması planlaşdırılır.
Field data (real user monitoring, RUM) comes from real visits: real devices, networks, caches and interactions. Lab data comes from loading the page in a controlled setup. Core Web Vitals are defined on field data; the lab is where you debug.
Field data
- CrUX (Chrome UX Report) aggregates data from real Chrome users who opted in, over a rolling 28-day window, per origin and per URL when there is enough traffic. You see it in PageSpeed Insights, Search Console and the CrUX API. Because the window is 28 days, a fix shows up in CrUX gradually.
- Your own RUM, usually with Google's
web-vitalslibrary. It applies the official rules (LCP candidates, CLS session windows, INP outliers) and reports CLS and INP when the page is hidden, because they can keep changing until then.
import { onCLS, onINP, onLCP } from "web-vitals/attribution";
function send(metric) {
const body = JSON.stringify({
name: metric.name,
value: metric.value,
rating: metric.rating,
id: metric.id,
attribution: metric.attribution,
});
navigator.sendBeacon("/analytics/vitals", body);
}
onLCP(send);
onCLS(send);
onINP(send);The attribution build adds the "why": the LCP element and its four sub-parts, the element that shifted most, the INP target and its three phases. onFID was removed in web-vitals v5 (2025); v6 (2026) added support for soft navigations.
Browser support matters for RUM. largest-contentful-paint and Event Timing entries (with interactionId, which INP needs) are available in Chromium, Firefox and Safari 26.2+, but layout-shift is Chromium-only, so your CLS data comes from Chromium users. CrUX itself contains Chrome users only.
Lab data
- Lighthouse loads the page once on an emulated mid-range phone with a throttled network. It reports LCP and CLS during load, but a page-load run has no user interactions, so instead of INP it reports Total Blocking Time as a proxy.
- The DevTools Performance panel shows live LCP, CLS and INP while you use the page, can compare them with CrUX, and its Insights include LCP breakdown, INP breakdown and Layout shift culprits.
Why the two disagree
Lab runs use a cold cache and one fixed device and viewport, and they stop at load. Real users have warm caches, different screens (different LCP elements), personalised content, and they scroll and click: field CLS includes shifts long after load, and only the field has real INP. Decide what to fix from field data, then reproduce and verify in the lab.
Single-page apps are a special case: a route change is a "soft navigation". Chrome measures them by default since Chrome 151, and CrUX reports them as experimental metrics, planned to become stable in May 2027.
LCP-nin düzəldilməsi: onu dörd hissəyə böl
"LCP 4,1 saniyədir" cümləsi nəyi düzəltməli olduğunu demir. web.dev LCP-ni cəmi bütövə bərabər olan dörd alt hissəyə bölür:
| Alt hissə | Haradan → haraya | Yaxşı LCP-də təxmini payı |
|---|---|---|
| Time to First Byte (TTFB) | naviqasiyanın başlanğıcı → HTML-in ilk baytı | təxminən 40% |
| Resursun yüklənmə gecikməsi | TTFB → LCP resursunun yüklənməyə başlaması | 10%-dən az |
| Resursun yüklənmə müddəti | həmin resursun yüklənməsinin əvvəli → sonu | təxminən 40% |
| Elementin render gecikməsi | resurs yükləndi → LCP elementi render olundu | 10%-dən az |
LCP elementi sistem şriftindəki mətndirsə, resurs yoxdur: yüklənmə ilə bağlı hər iki hissə sıfırdır. DevTools-un LCP breakdown insight-ı və web-vitals-ın attribution build-i bu rəqəmləri verir; əvvəlcə ən böyüyünü düzəlt.
Hər alt hissə üçün
- TTFB: HTML-i CDN edge-də keşlə, redirect zəncirlərindən qaç, hamı üçün eyni olan səhifələri serverdə render et və ya əvvəlcədən render et (prerender). Server rendering klient işini aradan qaldırır, amma server vaxtı əlavə edir, ona görə hər ikisini ölç.
- Yüklənmə gecikməsi: LCP resursunu HTML-də aşkar ediləcək hala gətir ki, onu dərhal tapsın: JavaScript-in əlavə etdiyi şəkil və ya xarici stylesheet-dəki
background-imageyox, real<img src>(və yasrcset). Resurs mütləq CSS-dən və ya JS-dən gəlməlidirsə,<link rel="preload">əlavə et. Onafetchpriority="high"ver (ən çoxu bir-iki şəklə) və onu heç vaxtloading="lazy"etmə: lazy loading şəklin viewport-a yaxın olduğunu bilmək üçün layout-u gözləyir. - Yüklənmə müddəti: daha az bayt göndər: AVIF və ya WebP, telefonlar desktop şəkillərini yükləməsin deyə
srcset/sizes, ağlabatan sıxılma, şəkil CDN-i. - Render gecikməsi: şəkil gəlib, amma hələ göstərilmir. Tipik səbəblər:
<head>-dəki stylesheet-lər və sinxron skriptlər,<img>-i yalnız bundle işləyəndən sonra yaradan client-rendered tətbiq, səhifəni gizlədən A/B test skripti və main thread-dəki uzun tapşırıqlar.
Məhsul səhifəsinin hero şəkli
Platformadakı məhsul səhifəsi dizayn məsələsində əsas məhsul şəkli təbii LCP namizədidir. Ona yaxşı xidmət edən markup:
<link rel="preload" as="image" href="/img/sneaker-800.avif"
imagesrcset="/img/sneaker-400.avif 400w, /img/sneaker-800.avif 800w"
imagesizes="(max-width: 600px) 100vw, 50vw" fetchpriority="high" />
<img src="/img/sneaker-800.avif"
srcset="/img/sneaker-400.avif 400w, /img/sneaker-800.avif 800w"
sizes="(max-width: 600px) 100vw, 50vw"
width="800" height="800" alt="Runner sneaker, side view"
fetchpriority="high" />Preload yalnız <img> ilkin HTML-də olmayanda (məsələn, klientdə render olunanda) lazımdır; HTML-dədirsə, fetchpriority="high" olan <img> kifayətdir. Qalereyanın ilk ekrandan aşağıdakı şəkilləri loading="lazy" qala bilər. Render-i bloklayan resursları və preload scanner-i Kritik render yolu mövzusu ətraflı izah edir.
"LCP is 4.1 seconds" does not tell you what to fix. web.dev splits LCP into four sub-parts that add up to the whole:
| Sub-part | From → to | Rough share of a good LCP |
|---|---|---|
| Time to First Byte (TTFB) | navigation start → first byte of the HTML | about 40% |
| Resource load delay | TTFB → the LCP resource starts loading | under 10% |
| Resource load duration | start → end of that resource's download | about 40% |
| Element render delay | resource loaded → LCP element rendered | under 10% |
If the LCP element is text in a system font, there is no resource: both load parts are zero. The DevTools LCP breakdown insight and the web-vitals attribution build give you these numbers; fix the largest one first.
Per sub-part
- TTFB: cache HTML at a CDN edge, avoid redirect chains, render on the server or prerender pages that are the same for everyone. Server rendering removes client work but adds server time, so measure both.
- Load delay: make the LCP resource discoverable in the HTML so the finds it immediately: a real
<img src>(orsrcset), not an image inserted by JavaScript or abackground-imagein an external stylesheet. If it must come from CSS or JS, add<link rel="preload">. Give itfetchpriority="high"(on one or two images at most), and neverloading="lazy": lazy loading waits for layout to know the image is near the viewport. - Load duration: send fewer bytes: AVIF or WebP,
srcset/sizesso phones do not download desktop images, sensible compression, an image CDN. - Render delay: the image has arrived but is not shown yet. Typical causes are stylesheets and synchronous scripts in the
<head>, a client-rendered app that creates the<img>only after its bundle runs, an A/B testing script that hides the page, and long tasks on the main thread.
A product page hero
On the platform's product page design problem, the main product photo is the natural LCP candidate. Markup that serves it well:
<link rel="preload" as="image" href="/img/sneaker-800.avif"
imagesrcset="/img/sneaker-400.avif 400w, /img/sneaker-800.avif 800w"
imagesizes="(max-width: 600px) 100vw, 50vw" fetchpriority="high" />
<img src="/img/sneaker-800.avif"
srcset="/img/sneaker-400.avif 400w, /img/sneaker-800.avif 800w"
sizes="(max-width: 600px) 100vw, 50vw"
width="800" height="800" alt="Runner sneaker, side view"
fetchpriority="high" />The preload only matters when the <img> is not in the initial HTML (for example, it is rendered on the client); if it is, the <img> with fetchpriority="high" is enough. Gallery images below the fold can stay loading="lazy". The Critical Rendering Path topic covers render-blocking resources and the preload scanner in depth.
CLS-in düzəldilməsi: yer ayır, məzmunu itələmə
CLS üzrə demək olar ki, hər düzəliş eyni fikrə əsaslanır: yerin ölçüsünü məzmun gəlməzdən əvvəl müəyyən et və istifadəçinin artıq baxdığı məzmunun üstünə heç nə əlavə etmə.
Şəkillər, video və iframe-lər
Mediaya width və height atributlarını ver. Brauzerlər fayl yüklənməzdən əvvəl onları aspect ratio-ya çevirir, ona görə CSS onu responsive etsə belə, qutu ilk layout-dan düzgün hündürlükdə olur:
<img src="/img/sneaker-800.avif" width="800" height="800" alt="Runner sneaker, side view" />img {
max-width: 100%;
height: auto;
}
.video-embed {
aspect-ratio: 16 / 9;
}Reklamlar, embed-lər və gec gələn UI
- Ən ehtimal olunan ölçü üçün yeri
min-height(və yaaspect-ratio) ilə ayır və heç nə yüklənməyəndə də placeholder-i saxla; boş slotun yığılması da sürüşmədir. - Bannerlər, cookie bildirişləri və promo zolaqlar: onları ilk HTML-də render et ki, yerləri əvvəldən mövcud olsun, ya da məzmunu tərpətməyən overlay kimi göstər (aşağıda
position: fixed). Onları yüklənmədən sonra səhifənin yuxarısına əlavə etmək hər şeyi aşağı itələyir. - Yer ayıra bilmirsənsə, gec gələn məzmunu səhifədə daha aşağıda yerləşdir: yuxarıya yaxın əlavə olunan məzmun viewport-un daha böyük hissəsini tərpədir.
- Klikdən sonra görünən məzmun girişdən sonrakı 500 ms ərzində problem deyil. Özü-özünə yüklənən məzmun (sonsuz lentlər, "tövsiyə olunanlar" blokları) isə sabit ölçülü konteynerə düşməli və ya "Daha çox yüklə" klikini gözləməlidir.
Şriftlər
Web şrift əvəzedici şrifti əvəz edəndə mətnin eni və hündürlüyü dəyişə bilər. font-display: optional gec dəyişmənin qarşısını alır; dəyişməni saxlayırsansa, @font-face-də size-adjust ilə əvəzedici şriftin ölçülərini uyğunlaşdır (ascent-override və descent-override da kömək edir, amma Safari onları hələ dəstəkləmir) və ilk ekrana lazım olan bir-iki şrifti preload et.
Animasiyalar və back/forward cache
top, margin və ya height əvəzinə transform-u animasiya et; transform-lar layout sürüşməsi deyil. Səhifəni back/forward cache üçün uyğun saxla: oradan bərpa olunan səhifə istifadəçinin onu tərk etdiyi kimi görünür, yenidən yüklənib sürüşmədən.
Təcrübə et
Platformadakı banner-layout-shift incident-i səni yüklənmə zamanı "Add to cart" düyməsinin yerindən oynadığı məhsul səhifəsinin növbətçisi edir. DevTools-da Rendering panelində Layout Shift Regions-ı aç, Performance panelində səhifənin yenidən yüklənməsini qeydə al və hansı elementin, nə qədər və nəyə görə tərpəndiyini görmək üçün Layout shift culprits insight-ından istifadə et.
Almost every CLS fix is the same idea: decide the size of the space before the content arrives, and never insert something above content the user is already looking at.
Images, video and iframes
Give media width and height attributes. Browsers turn them into an aspect ratio before the file loads, so the box has the right height from the first layout, even when CSS makes it responsive:
<img src="/img/sneaker-800.avif" width="800" height="800" alt="Runner sneaker, side view" />img {
max-width: 100%;
height: auto;
}
.video-embed {
aspect-ratio: 16 / 9;
}Ads, embeds and late UI
- Reserve the slot with
min-height(oraspect-ratio) for the most likely size, and keep the placeholder when nothing loads; collapsing an empty slot is a shift too. - Banners, cookie notices and promo bars: render them in the first HTML so their space exists from the start, or show them as an overlay (
position: fixedat the bottom) that does not move the content. Inserting them at the top of the page after load pushes everything down. - If you cannot reserve space, put late content lower on the page: content inserted near the top moves more of the viewport.
- Content that appears after a click is fine within 500 ms of the input. Content that loads on its own (infinite feeds, "recommended" blocks) should go into a fixed-size container or wait for a "Load more" click.
Fonts
When a web font replaces the fallback, text can change width and height. font-display: optional avoids the late swap; if you swap, match the fallback's metrics with size-adjust in @font-face (ascent-override and descent-override help too, but Safari does not support them yet) and preload the one or two fonts the first screen needs.
Animations and the back/forward cache
Animate transform instead of top, margin or height; transforms are not layout shifts. And keep the page eligible for the back/forward cache: a page restored from it appears as the user left it, without loading and shifting again.
Practise it
The platform's banner-layout-shift incident puts you on call for a product page where "Add to cart" moves while the page loads. In DevTools, turn on Layout Shift Regions in the Rendering drawer, record a reload in the Performance panel, and use the Layout shift culprits insight to see which element moved, by how much, and what caused it.
INP-nin düzəldilməsi: uzun tapşırıqlar, yield və hər qarşılıqlı əlaqədə daha az iş
Əvvəlcə field data-da yavaş qarşılıqlı əlaqələri tap (hansı element, hansı mərhələ), sonra onları CPU throttling ilə Performance panelində təkrarla və INP breakdown insight-ını oxu. Sonra üstünlük təşkil edən mərhələni düzəlt.
Input gecikməsi: main thread-i boş saxla
50 ms-dən uzun çəkən hər tapşırıq uzun tapşırıqdır və onun ortasında gələn giriş gözləməli olur. Adi mənbələr yüklənmə zamanı skriptlərin icrası və , üçüncü tərəf teq-ləri və ağır iş görən taymerlərdir. Başlanğıcda daha az JavaScript göndər və icra et, hydration-ı hissələrə böl (Suspense sərhədləri müstəqil hydrate olunur), təcili olmayan işi isə sonraya saxla.
Emal: daha az iş gör və yield et
Əvvəlcə qarşılıqlı əlaqənin nəticəsini göstər, qalanını sonra et. İşi bir neçə tapşırığa bölmək brauzerə arada kadrı çəkmək və növbəti girişi emal etmək imkanı verir:
function yieldToMain() {
if (globalThis.scheduler?.yield) {
return scheduler.yield();
}
return new Promise((resolve) => setTimeout(resolve, 0));
}
addToCartButton.addEventListener("click", async () => {
cartBadge.textContent = String(cart.add(product));
await yieldToMain();
saveCartToStorage(cart);
sendAnalytics("add_to_cart", product.id);
});scheduler.yield() promise qaytarır və onun davamı eyni prioritetli digər növbədəki tapşırıqlardan əvvəl işləyir, ona görə qalan işin, setTimeout(0) davamında olduğu kimi, kənar skriptlərin arxasına düşmür. MDN onu Limited availability kimi işarələyir: Chrome və Edge 129+, Firefox 142+, Safari-də hələ yoxdur; setTimeout fallback-i buna görədir. Uzun dövrdə hər elementdən sonra yox, təxminən hər 50 ms-lik işdən sonra yield et.
Göstərilmə gecikməsi: növbəti kadrı ucuzlaşdır
Handler-dən sonrakı kadr stili yenidən hesablamalı, layout və paint etməlidir. DOM-u kiçik saxla, handler-lərdə -dən qaç, böyük innerHTML hissələrini əvəz etmək yerinə nöqtəvi yeniləmələrə üstünlük ver, ekrandan kənardakı uzun məzmun üçün content-visibility istifadə et. Bunları Reflow, repaint və layout thrashing mövzusu ətraflı izah edir.
React: bir qarşılıqlı əlaqədə böyük re-render-lərdən qaç
React-də emal vaxtının çoxunu render tutur. Bütün səhifəni yenidən render edən düymə basışı klassik INP problemidir. Hər qarşılıqlı əlaqədəki render işini ölçməyi Typing lag challenge-ində məşq etmək olar.
- State-i istifadə olunduğu yerə yaxın saxla ki, dəyişiklik kiçik alt ağacı yenidən render etsin.
- Baha övladları memoize et (
memo,useMemovə ya bunu avtomatik edən, oktyabr 2025-dən stabil olan React Compiler). - Təcili olmayan yeniləmələri
startTransition/useTransitionilə işarələ, ya dauseDeferredValueilə geridə qalan dəyər əldə et: baha siyahı arxa planda yenidən render olunur və növbəti düymə basışı onu dayandırır. Input-un öz dəyəri isə adi, təcili yeniləmə kimi qalmalıdır. - Minlərlə sətri render etmək əvəzinə uzun siyahıları virtualizasiya et.
Məhsul səhifəsində variant seçicisi və "Add to cart" üçün büdcə qoy: hər biri səhifənin kiçik bir hissəsini yeniləməli, analitika və yaddaşa yazmanı isə sonraya saxlamalıdır.
Find the slow interactions in field data first (which element, which phase), then reproduce them in the Performance panel with CPU throttling and read the INP breakdown insight. Then fix the phase that dominates.
Input delay: keep the main thread free
Any task longer than 50 ms is a long task, and an input that arrives during it waits. The usual sources are script evaluation and during load, third-party tags, and timers doing heavy work. Ship and run less JavaScript at startup, split hydration (Suspense boundaries hydrate independently), and move non-urgent work out of the way.
Processing: do less, and yield
Show the result of the interaction first and do the rest later. Splitting work into several tasks gives the browser a chance to paint and to handle the next input in between:
function yieldToMain() {
if (globalThis.scheduler?.yield) {
return scheduler.yield();
}
return new Promise((resolve) => setTimeout(resolve, 0));
}
addToCartButton.addEventListener("click", async () => {
cartBadge.textContent = String(cart.add(product));
await yieldToMain();
saveCartToStorage(cart);
sendAnalytics("add_to_cart", product.id);
});scheduler.yield() returns a promise, and its continuation runs before other queued tasks of the same priority, so your remaining work does not end up behind unrelated scripts the way a setTimeout(0) continuation can. MDN marks it as Limited availability: Chrome and Edge 129+, Firefox 142+, not yet Safari, hence the setTimeout fallback. In a long loop, yield every ~50 ms of work rather than after every item.
Presentation delay: make the next frame cheap
The frame after the handler has to recalculate style, lay out and paint. Keep the DOM small, avoid in handlers, prefer targeted updates to replacing big chunks of innerHTML, and use content-visibility for long off-screen content. The Reflow, repaint and layout thrashing topic covers these in detail.
React: avoid big re-renders per interaction
In React, processing time is mostly rendering. A keystroke that re-renders the whole page is the classic INP problem. The Typing lag challenge is a good place to practise measuring rendering work per interaction.
- Keep state close to where it is used, so a change re-renders a small subtree.
- Memoize expensive children (
memo,useMemo, or React Compiler, stable since October 2025, which does it automatically). - Mark non-urgent updates with
startTransition/useTransition, or derive a lagging value withuseDeferredValue: the expensive list re-renders in the background and is interrupted by the next keystroke. The input's own value must stay a normal, urgent update. - Virtualize long lists instead of rendering thousands of rows.
On a product page, budget the variant picker and "Add to cart": each should update a small part of the page and defer analytics and storage.
Müsahibə üçün məsləhətlər
- Üç göstəricini nəyi ölçdükləri və hədləri ilə birlikdə say. LCP (yüklənmə) ≤ 2,5 s, INP (reaksiya) ≤ 200 ms, CLS (vizual sabitlik) ≤ 0,1; pis hədlər 4 s, 500 ms və 0,25-dən yuxarıdır. Rəqəmləri mənalı edən qaydanı da əlavə et: səhifə yükləmələrinin 75-ci persentilində, mobil və desktop üçün ayrılıqda qiymətləndirilir.
- Yaxın tarixi bil. INP 12 mart 2024 tarixində FID-i əvəz etdi, çünki FID yalnız ilk qarşılıqlı əlaqənin input gecikməsini ölçürdü. FID-dən aktual göstərici kimi danışmaq köhnə məlumatla gəldiyini göstərməyin ən asan yoludur.
- Hər rəqəmin necə yarandığını izah et. LCP: ilk qarşılıqlı əlaqəyə qədər namizədlər; görünən ölçü nəzərə alınır. CLS: hər sürüşmə üçün impact × distance, sessiya pəncərələrinə qruplaşdırma (1 saniyədən az fasilə, ən çoxu 5 saniyə), ən pis pəncərə qalib gəlir, girişdən sonrakı 500 ms-dəki sürüşmələr nəzərə alınmır. INP: hər 50-dən bir kənar qiymət atılmaqla ən pis qarşılıqlı əlaqə; input gecikməsi, emal və göstərilmə gecikməsinə bölünür.
- Field-i laboratoriyadan ayır. CrUX və RUM (
web-vitals) nəyi düzəltməli olduğunu müəyyən edir; Lighthouse və Performance paneli problemi təkrarlamağa və yoxlamağa kömək edir. Səhifə yükləməsində Lighthouse-da INP yoxdur, TBT sadəcə proksidir.layout-shiftentry-lərinin yalnız Chromium-da olduğunu da qeyd et. - Düzəltməzdən əvvəl diaqnoz qoy. LCP-ni TTFB, yüklənmə gecikməsi, yüklənmə müddəti və render gecikməsinə böl və ən böyüyündən başla. INP-də yavaş mərhələni tap. CLS-də hansı elementin tərpəndiyini və niyə tərpəndiyini tap.
- Həlləri səbəbə bağla.
fetchpriority="high"ilə aşkar edilə bilən LCP şəkli, ilk ekranda lazy-loading-in olmaması;width/heightvə yaaspect-ratio, bannerlər və reklamlar üçün ayrılmış yer; qısa tapşırıqlar, fallback-lischeduler.yield(), kiçik re-render-lər. - System design sualında (məsələn, məhsul səhifəsi) hər göstərici üçün büdcə qoy və dizaynın ona necə cavab verdiyini de: LCP kimi serverdə render olunan məhsul şəkli, qiymət, rəylər və promo üçün ayrılmış yer, əvvəlcə badge-i yeniləyib qalanını sonraya saxlayan "Add to cart" handler-i.
Qaçmalı olduğun yanlış ifadələr: "CLS ziyarət boyu bütün sürüşmələri toplayır" (yalnız ən pis sessiya pəncərəsi sayılır), "Google laboratoriya ballarından istifadə edir" (Core Web Vitals field data-dan istifadə edir), "will-change və ya CDN INP-ni düzəldir" (INP hər qarşılıqlı əlaqədə main thread-də görülən işdir) və "qarşılıqlı əlaqəsi olmayan səhifənin INP-si 0-dır" (onun INP-si ümumiyyətlə yoxdur).
- Name the three metrics with what they measure and their thresholds. LCP (loading) ≤ 2.5 s, INP (responsiveness) ≤ 200 ms, CLS (visual stability) ≤ 0.1; poor above 4 s, 500 ms and 0.25. Add the rule that makes the numbers meaningful: assessed at the 75th percentile of page loads, separately for mobile and desktop.
- Know the recent history. INP replaced FID on March 12, 2024, because FID measured only the input delay of the first interaction. Saying "FID" as a current metric is an easy way to sound out of date.
- Explain how each number is built. LCP: candidates until the first interaction; the visible size counts. CLS: impact × distance per shift, grouped into session windows (gaps under 1 s, at most 5 s), worst window wins, shifts within 500 ms of input excluded. INP: worst interaction with one outlier ignored per 50, split into input delay, processing and presentation delay.
- Separate field from lab. CrUX and RUM (
web-vitals) decide what to fix; Lighthouse and the Performance panel help you reproduce and verify. Lighthouse has no INP on a page load; TBT is only a proxy. Mention thatlayout-shiftentries exist only in Chromium. - Diagnose before fixing. For LCP, break it into TTFB, load delay, load duration and render delay and attack the largest. For INP, find the slow phase. For CLS, find the element that moved and why.
- Tie fixes to the cause. Discoverable LCP image with
fetchpriority="high", no lazy-loading above the fold;width/heightoraspect-ratio, reserved slots for banners and ads; shorter tasks,scheduler.yield()with a fallback, smaller re-renders. - For a system design question (a product page, say), set a budget per metric and say how the design meets it: the server-rendered product photo as LCP, reserved space for price, reviews and promos, and an "Add to cart" handler that updates the badge first and defers the rest.
Misstatements to avoid: "CLS adds up every shift during the visit" (only the worst session window counts), "lab scores are what Google uses" (Core Web Vitals use field data), "will-change or a CDN fixes INP" (INP is main-thread work per interaction), and "a page without interactions has an INP of 0" (it has no INP).
Kodu Core Web Vitals baxımından review edərkən nəyi yoxlamalı
Bu yoxlama siyahısı sənin yazmadığın və ilk ekrana, gec yüklənən məzmuna və ya hadisə handler-lərinə toxunan dəyişikliyi (komanda yoldaşının pull request-ini, kitabxanadan götürülmüş snippet-i və ya AI assistentin təklifini) review edəndə lazımdır. Öz noutbukunda səhifənin tez açılması az şey sübut edir: Core Web Vitals real istifadəçilərin məlumatlarından hesablanır.
- Yeni şəkil, video və iframe-lərdə
widthvəheightvə yaaspect-ratiovarmı? Yoxdursa, fayl gələnə qədər qutunun hündürlüyü olmur və aşağıdakı hər şey sıçrayır. Bunu DevTools-un Rendering panelindəki Layout Shift Regions göstərir. - Özü-özünə yüklənən məzmun (reklam, embed, "tövsiyə olunanlar" bloku) üçün yer o gəlməzdən əvvəl ayrılıbmı? Heç nə yüklənməyəndə də yerində qalan,
min-heightvə yaaspect-ratioilə verilmiş slot axtar. Performance panelindəki Layout shift culprits insight-ı tərpənən elementi göstərir. - LCP şəkli HTML-də real
<img>-dirmi, ondafetchpriority="high"var vəloading="lazy"yoxdurmu? JavaScript-in əlavə etdiyi və ya CSS-də verilən şəkli tapa bilmir, lazy loading isə layout-u gözləyir. Hansı hissənin ləng olduğunu LCP breakdown insight-ı göstərir. - Klik və ya düymə handler-i bütün işini növbəti paint-dən əvvəl görürmü? INP məhz bu gözləməni ölçür. Əvvəlcə istifadəçinin gördüyünü yenilə, sonra yaddaşa yazma və analitikadan əvvəl yield et (
scheduler.yield()və yasetTimeoutfallback-i); ləng mərhələni INP breakdown insight-ı göstərir. - Animasiya məzmunu
top,marginvə yaheightilə hərəkət etdirirmi, yaxud yeni web şrift gələndə mətnin ölçüsünü dəyişirmi? İkisi də layout sürüşməsi yarada bilər. Əvəzindətransform-u animasiya et; şriftlər üçünfont-display: optionalvə yasize-adjustistifadə et. - Monitorinq kodu FID-dən yox,
onLCP,onCLSvəonINP-dən istifadə edirmi?onFIDweb-vitalsv5-dən bəri yoxdur; Lighthouse-un səhifə yükləməsi ölçümündə isə INP yoxdur, onun əvəzinə proksi kimi Total Blocking Time var.
Use this list when you review a change you did not write (a teammate's pull request, a library's snippet or an AI assistant's suggestion) that touches the first screen, late-loading content or event handlers. A fast run on your laptop proves little: Core Web Vitals come from real users.
- Do new images, videos and iframes have
widthandheightor anaspect-ratio? Otherwise the box has no height until the file arrives, and everything below jumps. Layout Shift Regions in the DevTools Rendering drawer shows it. - Does content that loads on its own (an ad, an embed, a "recommended" block) have space reserved before it arrives? Look for a
min-heightoraspect-ratioslot that stays when nothing loads. The Performance panel's Layout shift culprits insight names the element that moved. - Is the LCP image a real
<img>in the HTML, withfetchpriority="high"and noloading="lazy"? The cannot find images added by JavaScript or set in CSS, and lazy loading waits for layout. The LCP breakdown insight shows the slow part. - Does a click or key handler do all its work before the next paint? INP measures that wait. Update what the user sees first, then yield (
scheduler.yield()or asetTimeoutfallback) before storage or analytics; the INP breakdown insight shows the slow phase. - Does an animation move content with
top,marginorheight, or a web font change text size when it swaps in? Both can cause layout shifts. Animatetransforminstead; for fonts, usefont-display: optionalorsize-adjust. - Does monitoring code use
onLCP,onCLSandonINP, not FID?onFIDis gone sinceweb-vitalsv5; a Lighthouse page-load run has no INP, only Total Blocking Time as a proxy.
Özünü yoxla
Təcrübədə sına
Bu mövzudan istifadə edən praktiki işlər.