Core Web Vitals چیست؟ بررسی LCP، INP و CLS و تأثیر آن‌ها بر سرعت و سئو سایت

What Are Core Web Vitals? A Technical Guide to LCP, INP, CLS, and SEO Core Web Vitals چیست؟ بررسی LCP، INP و CLS و تأثیر آن‌ها بر سرعت و سئو سایت

What Are Core Web Vitals? A Technical Guide to LCP, INP, CLS, and SEO

Building a successful website is not only about creating an attractive design. Users expect pages to load quickly, interactions to respond without noticeable delays, and content to remain visually stable while the page is loading.

This is where Core Web Vitals become important. Core Web Vitals are a set of important user experience metrics that focus on three major aspects of web performance: loading performance, responsiveness, and visual stability.

In this article from Just Programmer, we will explore what Core Web Vitals are, how LCP, INP, and CLS work, what causes poor scores, and how developers can improve website performance.


What Are Core Web Vitals?

Core Web Vitals are a set of standardized metrics used to measure important aspects of user experience on web pages.

The three current Core Web Vitals are:

  • LCP — Largest Contentful Paint: Measures loading performance.
  • INP — Interaction to Next Paint: Measures responsiveness to user interactions.
  • CLS — Cumulative Layout Shift: Measures visual stability.

These metrics focus on three important parts of the user experience:

Loading
   ↓
LCP

Interaction
   ↓
INP

Visual Stability
   ↓
CLS

The goal of Core Web Vitals is not simply to generate a score. Instead, these metrics help developers understand how users actually experience a web page.


How Are Core Web Vitals Related to SEO?

Core Web Vitals are connected to page experience and Google's ranking systems. Google states that Core Web Vitals are used by its ranking systems and recommends that website owners maintain good Core Web Vitals.

However, an important misconception should be avoided: excellent Core Web Vitals do not automatically place a website in the first position of Google Search.

Search rankings depend on many different factors. Content relevance, content quality, site structure, helpfulness, and many other signals also matter.

Therefore, Core Web Vitals should not be optimized only to achieve a high SEO score. The main goal should be to provide a fast, responsive, and stable experience for real users.


What Is LCP? Largest Contentful Paint

LCP stands for Largest Contentful Paint. It measures how long it takes for the largest visible content element in the viewport to be rendered.

This element may be a large image, a text block, or a video.

In simple terms, LCP answers this question:

“How quickly does the main content of the page become visible to the user?”

For example, if a page has a large Hero image and that image is the largest visible element, its rendering can have a significant impact on LCP.

LCP Thresholds

LCP Status
≤ 2.5 seconds Good
2.5 – 4 seconds Needs Improvement
> 4 seconds Poor

For evaluating the experience of most users, the 75th percentile of page loads is commonly used, segmented by mobile and desktop devices. A good LCP target is 2.5 seconds or less. :contentReference[oaicite:13]{index=13}


What Causes a High LCP?

A poor LCP can have many different causes, and the problem is not always simply a large image.

  • Slow server response
  • High TTFB
  • Large or unoptimized images
  • Heavy CSS files
  • Slow-loading web fonts
  • Render-blocking resources
  • Heavy JavaScript
  • Unnecessary redirects
  • Slow network conditions
  • Poor resource loading strategies

How to Improve LCP

  • Compress large images and use WebP or AVIF when appropriate.
  • Give important above-the-fold images appropriate loading priority.
  • Reduce unnecessary CSS.
  • Identify and optimize render-blocking resources.
  • Improve server response time.
  • Use caching and CDNs when appropriate.
  • Optimize font loading.
  • Move unnecessary JavaScript away from the critical loading path.

What Is INP? Interaction to Next Paint

INP stands for Interaction to Next Paint and measures how responsive a page is to user interactions.

An interaction may include clicking a button, tapping an element, selecting an option, or performing another action on a page.

In simple terms, INP measures how quickly the browser can present a visual response after a user interaction.

INP replaced FID as a Core Web Vital in 2024. :contentReference[oaicite:14]{index=14}

INP Thresholds

INP Status
≤ 200 ms Good
200 – 500 ms Needs Improvement
> 500 ms Poor

An INP of 200 milliseconds or less is considered good. The 75th percentile is commonly used for evaluating user experience across mobile and desktop devices. :contentReference[oaicite:15]{index=15}


Why Can INP Be Poor?

One of the most common causes of poor INP is long-running JavaScript work on the browser's Main Thread.

Imagine that a user clicks a button while the browser is simultaneously executing a heavy JavaScript task. Until the browser can process the work, the visual response to the user's interaction may be delayed.

User Interaction
      ↓
JavaScript Event
      ↓
Long Task
      ↓
Main Thread Busy
      ↓
Delayed Visual Update
      ↓
Poor INP

How to Improve INP

  • Reduce unnecessary JavaScript.
  • Break long tasks into smaller tasks.
  • Reduce expensive calculations inside event handlers.
  • Optimize event listeners.
  • Use Web Workers for suitable heavy processing.
  • Reduce unnecessary JavaScript dependencies.
  • Avoid expensive work immediately after user interactions.

What Is CLS? Cumulative Layout Shift

CLS stands for Cumulative Layout Shift and measures the visual stability of a page.

Have you ever tried to click a button, only for an image or advertisement to load and suddenly move the button somewhere else? This is an example of a poor experience caused by layout shifts.

CLS measures the amount of unexpected visual movement that occurs during a page experience.

CLS Thresholds

CLS Status
≤ 0.1 Good
0.1 – 0.25 Needs Improvement
> 0.25 Poor

A good CLS target is 0.1 or less, with the 75th percentile commonly used to evaluate the experience of most users. :contentReference[oaicite:16]{index=16}


What Causes Poor CLS?

One of the most common causes of CLS is failing to reserve space for elements before they load.

For example:

<img src="hero.webp" alt="Hero Image">

In this case, the browser may not know the exact space required by the image before it loads.

A better approach is to define the image dimensions:

<img
    src="hero.webp"
    width="1200"
    height="700"
    alt="Hero Image"
>

Other common causes include:

  • Images without defined dimensions
  • Advertisements and iframes without reserved space
  • Dynamically injected content
  • Late-loading web fonts
  • Elements changing size after rendering
  • Unexpected banners or notifications

Images without dimensions, advertisements, iframes, dynamically injected content, and web fonts are among the common causes of layout shifts. :contentReference[oaicite:17]{index=17}


LCP vs INP vs CLS

Metric What Does It Measure? Good Target
LCP Main content loading performance ≤ 2.5s
INP Responsiveness to interactions ≤ 200ms
CLS Visual stability ≤ 0.1

What Is the Difference Between Field Data and Lab Data?

When measuring website performance, you may encounter two major types of data: Field Data and Lab Data.

What Is Field Data?

Field Data is collected from real users under real-world conditions. Device capabilities, network conditions, browser behavior, and other environmental factors can affect the results.

For this reason, Field Data provides a more realistic picture of how users experience a website.

What Is Lab Data?

Lab Data is generated in a controlled testing environment with predefined conditions. It is very useful for identifying technical problems and testing performance improvements.

As a result, a page can perform well in a laboratory test while real users experience different results on different devices and networks.


What Is PageSpeed Insights?

PageSpeed Insights is a popular tool for analyzing web page performance. It can provide information about page performance and user-experience-related metrics.

For developers, PageSpeed Insights can be a useful starting point for identifying performance problems, but it should not be the only source of performance analysis.

Real-user data should also be considered when evaluating website performance.


Core Web Vitals in Google Search Console

Google Search Console also provides a Core Web Vitals report that helps website owners understand the performance of their pages.

The report can be especially useful for identifying groups of pages that share performance problems.

Instead of focusing only on one URL or one number, developers should look for recurring patterns across their pages.


A Real-World Performance Analysis Example

Imagine that a page produces the following results:

LCP = 4.8s
INP = 280ms
CLS = 0.32

All three metrics need improvement.

We can investigate the problems step by step.

Step 1 — LCP

Suppose the Hero image is extremely large. We can optimize it:

Large Image
    ↓
Compression
    ↓
WebP / AVIF
    ↓
Better Loading Priority
    ↓
Lower LCP

Step 2 — INP

If heavy JavaScript is blocking the Main Thread, we can identify Long Tasks and reduce unnecessary work.

Heavy JavaScript
      ↓
Long Tasks
      ↓
Main Thread Blocked
      ↓
Interaction Delay
      ↓
Optimize JavaScript
      ↓
Better INP

Step 3 — CLS

If images, advertisements, or dynamic elements appear without reserved space, we should reserve the required space before those elements load.

Undefined Element Size
        ↓
Layout Shift
        ↓
Higher CLS

Defined Space
        ↓
Stable Layout
        ↓
Lower CLS

Therefore, performance optimization is usually not a single-step task. It is a combination of many technical improvements.


How Can You Improve Core Web Vitals?

  • Compress images and use appropriate formats.
  • Define image dimensions.
  • Reduce unnecessary CSS and JavaScript.
  • Identify and optimize Long Tasks.
  • Improve server response time.
  • Use caching where appropriate.
  • Use a CDN when it makes sense for the project.
  • Optimize font loading.
  • Reserve space for dynamic content.
  • Monitor real-user performance data.
  • Test pages on both mobile and desktop devices.

Common Core Web Vitals Optimization Mistakes

Focusing Only on Lighthouse Scores

A good laboratory score does not mean that every real user will experience the page in exactly the same way. Real-world conditions vary significantly.

Thinking Core Web Vitals Is the Only SEO Factor

Core Web Vitals are important, but Google Search rankings are not determined by a single metric.

Optimizing Only for Desktop

Many users browse the web on mobile devices, and page performance can vary significantly across devices and networks.

Focusing Too Much on One Number

The final goal should be a fast and usable website, not simply achieving a specific score.


Core Web Vitals Quick Checklist

  • ☐ LCP is within the recommended range.
  • ☐ INP is within the recommended range.
  • ☐ CLS is low.
  • ☐ Images have defined dimensions.
  • ☐ Large images are optimized.
  • ☐ Unnecessary JavaScript has been reduced.
  • ☐ Long Tasks have been investigated.
  • ☐ Server response time has been optimized.
  • ☐ Mobile performance has been tested.
  • ☐ Real-user data has been considered.

Frequently Asked Questions About Core Web Vitals

What metrics are included in Core Web Vitals?

The current Core Web Vitals are LCP for loading performance, INP for responsiveness, and CLS for visual stability. :contentReference[oaicite:18]{index=18}

Do Core Web Vitals automatically make a page rank first on Google?

No. Core Web Vitals are used by Google's ranking systems, but good Core Web Vitals alone do not guarantee top rankings. :contentReference[oaicite:19]{index=19}

What is a good LCP?

An LCP of 2.5 seconds or less is considered good. Values above 4 seconds are considered poor. :contentReference[oaicite:20]{index=20}

What is a good INP?

An INP of 200 milliseconds or less is considered good. Values above 500 milliseconds are considered poor. :contentReference[oaicite:21]{index=21}

What is a good CLS?

A CLS of 0.1 or less is considered good, while values above 0.25 are considered poor. :contentReference[oaicite:22]{index=22}

Is FID still a Core Web Vital?

No. INP replaced FID as the Core Web Vital used to measure responsiveness. :contentReference[oaicite:23]{index=23}


Conclusion

Core Web Vitals are important metrics for understanding how real users experience a web page. They focus on three major areas: loading performance through LCP, responsiveness through INP, and visual stability through CLS.

Improving these metrics is not only about search engines. It also helps developers build websites that feel faster, smoother, and easier to use.

However, Core Web Vitals should not be treated as a shortcut to the top of Google Search. The strongest approach combines performance with helpful content, good website structure, security, accessibility, and an overall high-quality user experience.

A fast website is not built only for Google; it is built for the people who use it every day.


© Just Programmer | Learn • Build • Grow

Core Web Vitals چیست؟ راهنمای فنی LCP، INP و CLS برای بهبود سرعت و سئو سایت

امروزه فقط زیبا بودن یک وب‌سایت برای موفقیت آن کافی نیست. کاربران انتظار دارند صفحات سریع بارگذاری شوند، دکمه‌ها و عناصر صفحه بدون تأخیر به تعاملات آن‌ها پاسخ دهند و هنگام بارگذاری محتوا، صفحه ناگهان جابه‌جا نشود.

اینجاست که مفهوم Core Web Vitals اهمیت پیدا می‌کند. Core Web Vitals مجموعه‌ای از معیارهای مهم برای اندازه‌گیری تجربه واقعی کاربران از یک صفحه وب است که سه جنبه مهم را بررسی می‌کند: سرعت بارگذاری، پاسخ‌گویی و پایداری بصری.

در این مقاله از Just Programmer، به‌صورت فنی بررسی می‌کنیم که Core Web Vitals چیست، معیارهای LCP، INP و CLS چه چیزی را اندازه‌گیری می‌کنند، چه عواملی باعث ضعیف شدن آن‌ها می‌شوند و چگونه می‌توان عملکرد یک وب‌سایت را بهبود داد.


Core Web Vitals چیست؟

Core Web Vitals مجموعه‌ای از معیارهای استاندارد است که برای اندازه‌گیری بخش‌های مهم تجربه کاربر در صفحات وب استفاده می‌شود.

سه معیار اصلی Core Web Vitals عبارت‌اند از:

  • LCP — Largest Contentful Paint: اندازه‌گیری سرعت نمایش محتوای اصلی صفحه
  • INP — Interaction to Next Paint: اندازه‌گیری میزان پاسخ‌گویی صفحه به تعاملات کاربر
  • CLS — Cumulative Layout Shift: اندازه‌گیری پایداری بصری صفحه

این سه معیار به ترتیب سه بخش مهم از تجربه کاربر را بررسی می‌کنند:

Loading
   ↓
LCP

Interaction
   ↓
INP

Visual Stability
   ↓
CLS

هدف Core Web Vitals این نیست که صرفاً یک عدد برای سایت تولید کند؛ بلکه این معیارها کمک می‌کنند بفهمیم کاربران هنگام استفاده واقعی از یک صفحه چه تجربه‌ای دارند.


Core Web Vitals چه ارتباطی با SEO دارد؟

Core Web Vitals با تجربه کاربر و سیستم‌های رتبه‌بندی Google ارتباط دارد. Google اعلام کرده است که Core Web Vitals در سیستم‌های رتبه‌بندی استفاده می‌شوند و توصیه می‌کند صاحبان سایت‌ها وضعیت این معیارها را بهبود دهند.

با این حال، یک تصور اشتباه وجود دارد: داشتن Core Web Vitals عالی به معنی قرار گرفتن خودکار در رتبه اول Google نیست.

رتبه‌بندی Google به مجموعه‌ای از عوامل مختلف وابسته است و Core Web Vitals تنها یکی از بخش‌های تجربه صفحه است. محتوای مفید، ارتباط محتوا با جست‌وجوی کاربر، کیفیت سایت، ساختار صفحات و عوامل مختلف دیگر نیز اهمیت دارند.

بنابراین بهتر است Core Web Vitals را فقط برای گرفتن یک امتیاز بالا در ابزارهای SEO بهینه نکنیم؛ هدف اصلی باید ساخت یک تجربه سریع، روان و قابل استفاده برای کاربران باشد.


LCP چیست؟ Largest Contentful Paint

LCP مخفف Largest Contentful Paint است و نشان می‌دهد بزرگ‌ترین عنصر محتوایی قابل مشاهده در بخش ابتدایی صفحه چه زمانی برای کاربر نمایش داده می‌شود.

این عنصر می‌تواند یک تصویر بزرگ، یک بلوک متنی یا یک ویدئو باشد.

به زبان ساده، LCP به این سؤال پاسخ می‌دهد:

«محتوای اصلی صفحه با چه سرعتی برای کاربر قابل مشاهده می‌شود؟»

برای مثال، اگر یک صفحه دارای یک تصویر بزرگ Hero باشد و آن تصویر بزرگ‌ترین عنصر قابل مشاهده باشد، زمان نمایش آن می‌تواند نقش مهمی در LCP داشته باشد.

محدوده‌های LCP

LCP وضعیت
تا ۲.۵ ثانیه خوب
بیشتر از ۲.۵ تا ۴ ثانیه نیازمند بهبود
بیشتر از ۴ ثانیه ضعیف

برای ارزیابی تجربه بیشتر کاربران، این معیار معمولاً در صدک ۷۵ و به تفکیک موبایل و دسکتاپ بررسی می‌شود. مقدار خوب LCP برابر با ۲.۵ ثانیه یا کمتر است. :contentReference[oaicite:2]{index=2}


چه عواملی باعث افزایش LCP می‌شوند؟

بالا بودن LCP می‌تواند دلایل مختلفی داشته باشد و همیشه مشکل فقط حجم تصویر نیست.

  • سرعت پایین پاسخ‌گویی سرور
  • TTFB بالا
  • تصاویر بزرگ و بهینه‌نشده
  • فایل‌های CSS سنگین
  • فونت‌های وب که دیر بارگذاری می‌شوند
  • منابع Render-Blocking
  • JavaScript سنگین
  • Redirectهای غیرضروری
  • شبکه یا اتصال کند کاربر
  • ساختار نامناسب بارگذاری منابع

چگونه LCP را بهبود دهیم؟

  • تصاویر بزرگ را فشرده و در صورت مناسب بودن به WebP یا AVIF تبدیل کنید.
  • تصویر اصلی صفحه را با اولویت مناسب بارگذاری کنید.
  • CSSهای غیرضروری را کاهش دهید.
  • منابع Render-Blocking را شناسایی و تا حد امکان بهینه کنید.
  • زمان پاسخ‌گویی سرور را کاهش دهید.
  • از Cache و CDN در سناریوهای مناسب استفاده کنید.
  • فونت‌ها را به شکل صحیح بارگذاری کنید.
  • JavaScript غیرضروری را از مسیر بحرانی بارگذاری صفحه خارج کنید.

INP چیست؟ Interaction to Next Paint

INP مخفف Interaction to Next Paint است و میزان پاسخ‌گویی صفحه به تعاملات کاربر را اندازه‌گیری می‌کند.

تعامل می‌تواند شامل کلیک روی یک دکمه، لمس صفحه، انتخاب یک گزینه یا انجام یک عملیات دیگر باشد.

به زبان ساده، INP بررسی می‌کند که بعد از تعامل کاربر، مرورگر با چه سرعتی بتواند نتیجه قابل مشاهده آن تعامل را نمایش دهد.

INP از سال ۲۰۲۴ جایگزین FID به‌عنوان یکی از Core Web Vitals شده است. :contentReference[oaicite:3]{index=3}

محدوده‌های INP

INP وضعیت
تا ۲۰۰ میلی‌ثانیه خوب
بیشتر از ۲۰۰ تا ۵۰۰ میلی‌ثانیه نیازمند بهبود
بیشتر از ۵۰۰ میلی‌ثانیه ضعیف

مقدار خوب INP برابر با ۲۰۰ میلی‌ثانیه یا کمتر است و برای ارزیابی کاربران معمولاً صدک ۷۵ بارگذاری‌ها به تفکیک موبایل و دسکتاپ بررسی می‌شود. :contentReference[oaicite:4]{index=4}


چرا INP در یک سایت ضعیف می‌شود؟

یکی از مهم‌ترین دلایل INP ضعیف، اجرای طولانی JavaScript روی Main Thread مرورگر است.

فرض کنید کاربر روی یک دکمه کلیک می‌کند، اما هم‌زمان مرورگر در حال اجرای یک عملیات سنگین JavaScript است. تا زمانی که مرورگر بتواند این کار را مدیریت کند، پاسخ به تعامل کاربر ممکن است به تأخیر بیفتد.

User Interaction
      ↓
JavaScript Event
      ↓
Long Task
      ↓
Main Thread Busy
      ↓
Delayed Visual Update
      ↓
Poor INP

راه‌های بهبود INP

  • کاهش JavaScript غیرضروری
  • تقسیم Long Taskها به وظایف کوچک‌تر
  • کاهش محاسبات سنگین در Event Handlerها
  • بهینه‌سازی Event Listenerها
  • استفاده مناسب از Web Worker برای برخی پردازش‌های سنگین
  • کاهش وابستگی‌های JavaScript غیرضروری
  • جلوگیری از اجرای عملیات سنگین بلافاصله پس از تعامل کاربر

CLS چیست؟ Cumulative Layout Shift

CLS مخفف Cumulative Layout Shift است و پایداری بصری صفحه را اندازه‌گیری می‌کند.

تا به حال شده هنگام باز کردن یک صفحه روی یک دکمه کلیک کنید، اما ناگهان یک تصویر یا تبلیغ بارگذاری شود و دکمه به سمت دیگری حرکت کند؟ این دقیقاً نمونه‌ای از یک تجربه بد ناشی از Layout Shift است.

CLS تلاش می‌کند میزان این جابه‌جایی‌های ناخواسته را اندازه‌گیری کند.

محدوده‌های CLS

CLS وضعیت
۰.۱ یا کمتر خوب
بیشتر از ۰.۱ تا ۰.۲۵ نیازمند بهبود
بیشتر از ۰.۲۵ ضعیف

برای تجربه خوب، مقدار CLS باید ۰.۱ یا کمتر باشد و ارزیابی معمولاً در صدک ۷۵ بارگذاری‌ها انجام می‌شود. :contentReference[oaicite:5]{index=5}


چه چیزهایی باعث CLS ضعیف می‌شوند؟

یکی از رایج‌ترین دلایل CLS، مشخص نکردن ابعاد عناصر قبل از بارگذاری آن‌ها است.

برای مثال:

<img src="hero.webp" alt="Hero Image">

در این حالت مرورگر ممکن است قبل از دریافت تصویر، فضای دقیق مورد نیاز آن را نداند.

بهتر است ابعاد تصویر مشخص باشد:

<img
    src="hero.webp"
    width="1200"
    height="700"
    alt="Hero Image"
>

دلایل رایج دیگر عبارت‌اند از:

  • تصاویر بدون ابعاد مشخص
  • تبلیغات و iframeهای بدون فضای رزروشده
  • اضافه شدن محتوای Dynamic به صفحه
  • بارگذاری دیرهنگام فونت‌ها
  • تغییر اندازه عناصر پس از Render
  • درج ناگهانی Banner یا Notification

تصاویر بدون ابعاد، تبلیغات و iframeهای بدون اندازه، محتوای Dynamic و Web Fontها از عوامل رایج Layout Shift هستند. :contentReference[oaicite:6]{index=6}


مقایسه LCP، INP و CLS

معیار چه چیزی را اندازه می‌گیرد؟ هدف خوب
LCP سرعت نمایش محتوای اصلی ≤ 2.5s
INP پاسخ‌گویی به تعاملات کاربر ≤ 200ms
CLS پایداری بصری صفحه ≤ 0.1

Field Data و Lab Data چه تفاوتی دارند؟

هنگام بررسی عملکرد سایت ممکن است با دو نوع داده مواجه شوید: Field Data و Lab Data.

Field Data چیست؟

Field Data یا داده‌های میدانی از تجربه واقعی کاربران در شرایط واقعی جمع‌آوری می‌شود. دستگاه، شبکه، موقعیت جغرافیایی، مرورگر و شرایط واقعی کاربر می‌توانند روی نتایج تأثیر بگذارند.

به همین دلیل Field Data تصویر واقعی‌تری از تجربه کاربران ارائه می‌دهد.

Lab Data چیست؟

Lab Data در یک محیط کنترل‌شده و با شرایط مشخص تولید می‌شود. این نوع داده برای پیدا کردن مشکلات فنی و آزمایش تغییرات بسیار مفید است.

بنابراین ممکن است یک صفحه در تست آزمایشگاهی عملکرد خوبی داشته باشد، اما کاربران واقعی در دستگاه‌ها و شبکه‌های مختلف تجربه متفاوتی داشته باشند.


PageSpeed Insights چیست؟

PageSpeed Insights یکی از ابزارهای شناخته‌شده برای بررسی عملکرد صفحات وب است. این ابزار می‌تواند اطلاعاتی درباره عملکرد صفحه و معیارهای مرتبط با تجربه کاربر ارائه کند.

برای توسعه‌دهندگان، PageSpeed Insights می‌تواند نقطه شروع خوبی برای پیدا کردن مشکلات Performance باشد؛ اما نباید تنها ابزار مورد استفاده باشد.

در کنار تست‌های آزمایشگاهی، بررسی داده‌های واقعی کاربران نیز اهمیت زیادی دارد.


Core Web Vitals در Google Search Console

Google Search Console نیز گزارشی برای Core Web Vitals ارائه می‌کند که به صاحبان سایت کمک می‌کند وضعیت صفحات خود را بررسی کنند.

این گزارش برای پیدا کردن گروه‌هایی از صفحات که در تجربه کاربران مشکل دارند بسیار مفید است.

نکته مهم این است که به جای تمرکز روی یک صفحه یا یک عدد خاص، باید الگوهای تکرارشونده در صفحات سایت را پیدا کرد.


یک مثال واقعی از تحلیل Performance

فرض کنید نتیجه بررسی یک صفحه به شکل زیر باشد:

LCP = 4.8s
INP = 280ms
CLS = 0.32

هر سه معیار در وضعیت مناسبی نیستند.

حالا مشکل را مرحله‌به‌مرحله بررسی می‌کنیم:

مرحله اول — LCP

اگر تصویر Hero بسیار بزرگ باشد، آن را بهینه می‌کنیم:

Large Image
    ↓
Compression
    ↓
WebP / AVIF
    ↓
Better Loading Priority
    ↓
Lower LCP

مرحله دوم — INP

اگر JavaScript سنگینی روی Main Thread اجرا شود، Long Taskها را بررسی کرده و عملیات غیرضروری را کاهش می‌دهیم.

Heavy JavaScript
      ↓
Long Tasks
      ↓
Main Thread Blocked
      ↓
Interaction Delay
      ↓
Optimize JavaScript
      ↓
Better INP

مرحله سوم — CLS

اگر تصاویر، تبلیغات یا عناصر Dynamic بدون فضای مشخص وارد صفحه شوند، باید فضای مورد نیاز آن‌ها از ابتدا مشخص شود.

Undefined Element Size
        ↓
Layout Shift
        ↓
Higher CLS

Defined Space
        ↓
Stable Layout
        ↓
Lower CLS

در نتیجه، بهینه‌سازی Performance معمولاً یک کار تک‌مرحله‌ای نیست؛ بلکه مجموعه‌ای از اصلاحات کوچک و فنی است.


چطور Core Web Vitals یک سایت را بهبود دهیم؟

  • تصاویر را فشرده و با فرمت مناسب ارائه کنید.
  • ابعاد تصاویر را مشخص کنید.
  • CSS و JavaScript غیرضروری را کاهش دهید.
  • Long Taskهای JavaScript را بررسی کنید.
  • سرعت پاسخ‌گویی Server را بهبود دهید.
  • از Cache در بخش‌های مناسب استفاده کنید.
  • در صورت نیاز از CDN استفاده کنید.
  • فونت‌ها را بهینه بارگذاری کنید.
  • برای عناصر Dynamic فضای مناسب در نظر بگیرید.
  • تجربه واقعی کاربران را با داده‌های میدانی بررسی کنید.
  • صفحات را روی موبایل و دسکتاپ جداگانه بررسی کنید.

اشتباهات رایج در بهینه‌سازی Core Web Vitals

فقط به امتیاز Lighthouse توجه کردن

یک امتیاز خوب در یک تست آزمایشگاهی به معنی تجربه یکسان برای تمام کاربران نیست. شرایط کاربران واقعی متفاوت است.

فکر کردن Core Web Vitals تنها عامل SEO است

Core Web Vitals مهم است، اما رتبه‌بندی Google به یک معیار محدود نمی‌شود.

بهینه‌سازی فقط برای دسکتاپ

بسیاری از کاربران از موبایل استفاده می‌کنند و عملکرد صفحه روی دستگاه‌ها و شبکه‌های مختلف می‌تواند متفاوت باشد.

تمرکز بیش از حد روی یک عدد

هدف نهایی ساخت یک تجربه سریع و قابل استفاده است، نه صرفاً رسیدن به یک امتیاز خاص.


چک‌لیست سریع Core Web Vitals

  • ☐ LCP در محدوده مناسب قرار دارد.
  • ☐ INP در محدوده مناسب قرار دارد.
  • ☐ CLS پایین است.
  • ☐ تصاویر دارای ابعاد مشخص هستند.
  • ☐ تصاویر بزرگ بهینه شده‌اند.
  • ☐ JavaScript غیرضروری کاهش یافته است.
  • ☐ Long Taskها بررسی شده‌اند.
  • ☐ Server Response بهینه است.
  • ☐ صفحات موبایل بررسی شده‌اند.
  • ☐ داده‌های واقعی کاربران بررسی شده‌اند.

سؤالات متداول درباره Core Web Vitals

Core Web Vitals شامل چه معیارهایی است؟

در حال حاضر سه معیار اصلی Core Web Vitals عبارت‌اند از LCP برای Loading، INP برای Responsiveness و CLS برای Visual Stability. :contentReference[oaicite:7]{index=7}

آیا Core Web Vitals مستقیماً باعث رتبه اول Google می‌شود؟

خیر. Core Web Vitals یکی از سیگنال‌های مورد استفاده در سیستم‌های رتبه‌بندی است و داشتن وضعیت خوب در آن به‌تنهایی تضمین‌کننده رتبه بالا نیست. :contentReference[oaicite:8]{index=8}

LCP خوب چقدر است؟

LCP برابر با ۲.۵ ثانیه یا کمتر در محدوده خوب قرار می‌گیرد. مقادیر بیشتر از ۴ ثانیه ضعیف محسوب می‌شوند. :contentReference[oaicite:9]{index=9}

INP خوب چقدر است؟

INP برابر با ۲۰۰ میلی‌ثانیه یا کمتر وضعیت خوبی دارد. مقادیر بیشتر از ۵۰۰ میلی‌ثانیه ضعیف محسوب می‌شوند. :contentReference[oaicite:10]{index=10}

CLS خوب چقدر است؟

CLS برابر با ۰.۱ یا کمتر وضعیت خوبی دارد و مقادیر بالاتر از ۰.۲۵ ضعیف محسوب می‌شوند. :contentReference[oaicite:11]{index=11}

آیا FID هنوز یکی از Core Web Vitals است؟

خیر. INP جایگزین FID شده و معیار اصلی برای سنجش Responsiveness در Core Web Vitals است. :contentReference[oaicite:12]{index=12}


جمع‌بندی

Core Web Vitals مجموعه‌ای از معیارهای مهم برای درک تجربه واقعی کاربران از یک صفحه وب است. این معیارها سه بخش اصلی را بررسی می‌کنند: سرعت نمایش محتوای اصلی با LCP، پاسخ‌گویی به تعاملات با INP و پایداری بصری با CLS.

بهینه‌سازی این معیارها فقط برای موتورهای جستجو نیست؛ بلکه مستقیماً به ساخت یک وب‌سایت سریع‌تر، روان‌تر و قابل استفاده‌تر کمک می‌کند.

با این حال، Core Web Vitals نباید به‌عنوان یک میانبر برای رسیدن به رتبه اول Google دیده شود. بهترین نتیجه زمانی به دست می‌آید که Performance در کنار محتوای مفید، ساختار مناسب، امنیت، دسترسی‌پذیری و تجربه کلی کاربر بهینه شود.

یک وب‌سایت سریع فقط برای Google ساخته نمی‌شود؛ برای انسان‌هایی ساخته می‌شود که هر روز از آن استفاده می‌کنند.


© Just Programmer | Learn • Build • Grow

Back to Articles