⚡ Every Web Developer should know what the Largest Contentful Paint is

The Largest Contentful Paint is one of the metrics to measure user's page experience on your website. It is a Core Web Vital and crucial for SEO.

👇 Learn more about the LCP and how to improve it
▶️ What is the Largest Contentful Paint (LCP)?

The LCP is a Core Web Vital focusing on the loading experience.

It measures the time until the largest element above the fold is rendered for your users. This is typical:

- an image
- a video
- a background image
- a headline Illustrations representing what above the fold means
▶️ Why is the LCP important?

The LCP is a Core Web Vital and has become crucial for modern SEO.

The user page experience on your website has become a factor in the googles algorithm to determine your website page rank.

The LCP is one of the metrics for the page experience.
▶️ How is the LCP measured?

The LCP does observe all elements above the fold until the page is interactive.

Usually, it is starting with a small element and is updated as soon as a new bigger element is loaded.

Once the page is interactive, the LCP will no longer update.
👇
It compares the element content box to determine whether a new element is larger or not.

The content box of an element does not contain the element margin, padding, or border.

If an element is clipped, it also ignores the hidden element parts.
▶️ What are the timings for a good LCP?️

The LCP is typical of the biggest element.
It is crucial to load fast to avoid blank space.

✅ You are outstanding with an LCP below 2.5 seconds. ⚡

⚠️ Being below 4 seconds may be adjusted.

🔴 More than 4 seconds should be fixed.
▶️ What are the reasons for a poor LCP?

The most common reasons for a poor LCP are:

1️⃣ Slow server response times
2️⃣ Render-blocking JS and CSS
3️⃣ Slow resource load times
4️⃣ Client-side rendering

They can be easily improved and adjusted.
👇 Let's have a look!.
1️⃣ Slow server response times

An indicator for a slow response time is a poor Time to First Byte (TTFB).

👉 If you encounter this issue, make sure there is no blocking code or query on your site.
Usually, expensive database queries or complex calculations can cause this.
👉 Modern frameworks may also slow down your server response times.

For example, a page needs to be created on the server.
If you use solutions like React, you may want to change into a static serving if you can.
👉 If you are not using a CDN, use it! It can greatly help to improve your loading time.

👉 If you use third-party connections, make sure you are preconnect to these URLs! This can also reduce your load time.
I have made a thread on that topic: . How to preconnect to a URL
2️⃣ Render-blocking CSS/JS

CSS or JS can block rendering as the load time and parse time may take too long.

👇 Here is how you can reduce render-blocking CSS
👉 Minify your CSS

You usually use white spaces, line breaks, and comments in your CSS for readability and editability.

Minifying will remove these and reduce the stylesheet size.

I have made a thread on that:
👉 Use critical CSS and defer non-critical CSS

Basically, this means you want to inline critical CSS for your content above the fold and defer any CSS below the fold and not required for the current user's view.

I have made a thread about that:
👉 Render-blocking JavaScript

Make sure to minify your JS, load only critical JS, and defer any non-critical JS not used on the current page.

I have made a thread on deferring loading and how it works:
3️⃣ Slow resource load times

Unoptimized resources on your webpage can also cause a poor LCP.

As mostly your media are the LCP, you want to ensure that your resources always perform well on your LCP.

Some tips and threads on how to optimize media loading:
👉 Use next-gen image formats

Next-gen image formats have better compression and keeping the quality of your images.

It reduces the network payload and will help to display your website a lot faster.

I have made a thread regarding next-gen images:
👉 Use scaled images

Scaled images will always serve images that are matching into the current position and size.

There is no need to load a 1080p image on a 200px times 200px element.

I have made a thread regarding that topic:
👉 Use different video formats

Using specific video formats can also greatly improve the slow loading time as the compression is mostly a lot better. It also reduces the file size in most cases.

Check out my thread regarding video formats:
4️⃣ Client-side rendering

Many websites are using client-side JavaScript logic to render your page.
Whether it is React, Vue or Angular.

Using server-side rendering can greatly improve the response time. At its best, you should use static file generation!
▶️ How can you measure your LCP?

A small list of known speed tooling websites, including Core Web Vitals:
- web dev: web.dev/measure/
- Page speed insight: developers.google.com/speed/pagespee…
- GTmetrix: gtmetrix.com
- WebPageTest: webpagetest.org/webvitals
▶️ What are Web Vitals?

Web Vitals are metrics by google that can be measured on every website. They have become crucial for SEO this year. Poor Web Vital metrics should be fixed!

I have made a thread regarding Web Vitals:
That was my second thread regarding Web Vitals.

Tomorrow I will publish a breakdown on the second Core Web Vital.
It will be the First Input Delay.
✅ Done

If you found this thread useful, consider following me @michaelketzer and retweet the first tweet! 🙏

Did I miss something? Please let me know 🙏

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Michael Ketzer 🚀

Michael Ketzer 🚀 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @michaelketzer

14 Sep
🔍 Every Front-End Developer should know the basics of how Google search works

Suppose you develop a Website you most likely want users to find your page. Optimize your page for Google ensures the correct audience will find your page.

↓ Learn how Google search works
The goal of a website is to be found in Google.

To show your website at Google, it goes through these 3 steps:
🔹 Crawling
🔹 Indexing
🔹 Serving

In this thread, we will take a closer look at all the steps.

{ 1 / 12 }
🔹 Crawling

Crawling is the first step. This is about finding your website in the first place.

Some pages are already known to Google through simple links. You can speed up this step with sitemaps.

Once Google has found your page, Google will crawl it.

{ 2 / 12 }
Read 15 tweets
9 Sep
⚡ Every Web Developer should know and use WebP images

The WebP image format is considered a next-gen image format and reduces the file size for images by 25-35%.
This is crucial for modern SEO and web performance.

👇 Read more about how to use WebP in seconds.
▶️ What is WebP?

WebP is an image format published by google in 2010.

It creates lossless images that are 26% smaller than PNG's and lossy images 25-34% smaller.
In reality, I have seen over 40% smaller sizes already.

And WebP supports transparency!

{ 1 / 7 }
▶️ What browsers are supporting WebP?

The current support includes all main browsers.
It supports Safari only for iOS or macOS Big Sur 11+.

Using the picture tag ensures compatibility for older browsers and fallback alternatives in other formats!

{ 2 / 7 } HTML picture tag with webp image
Read 9 tweets
6 Sep
⚡ Every Web Developer should know performance budgets

A performance budget is a set of constraints that apply to metrics that affect a website's performance. Having budgets helps to ensure your website performs well.

👇 Learn about web performance and performance budgets
▶️ Why is performance important?

Performance is an important part of the user experience, and it can directly impact your business.

User experience has also become a factor in Google page ranking.

Setting a performance budget defines the boundaries for your website.
▶️ What are performance budgets metrics?

Performance budgets can be categorized into:

🔹 Quantity metrics
🔹 Timing metrics
🔹 Rule-based metrics

👇 Let's have a look at what each of them means
Read 15 tweets
2 Sep
⚡ Every Web Developer should know how to serve properly sized images

Serving images in the correct image dimensions is crucial for web performance. Loading incorrect sizes can increase the network payload.

👇 Learn how to serve the correct mage sizes in seconds
▶️ Why is this important to web performance?

Incorrectly sized images either increase your network payload, or the other way around, causes to have blurry images.

For example, a stock photo is usually 11MB. Proper size/compress can reduce it down to 400kb.
▶️ How can you determine the correct image size?

To identify the correct image sizes, we need to take care of the defined CSS units first.

🔸 Absolute units: px, rem, mm, in, cm
🔹 Relative units: %, vw, em

Relative units are responsive. The picture has no fixed size.
Read 13 tweets
9 Aug
⚡ Every Web Developer should know how to serve scaled images

Serving your images scaled is crucial to ensure your performance is fantastic and your website loads fast for any of your users.

👇 Learn how to create and serve scaled images in seconds
1️⃣ What are scaled images?

A scaled image is an image that is created in different size variants to match the displayed size for your user.

It does allow you to serve drastically smaller images when there is no need for huge images.

👇
For example, having a full-screen image on a desktop device may serve with 1920px, a tablet with 1024px, and a mobile with only 460px.

There is no need to load a 1920px image on a mobile device.

Using scaled images will automatically load the appropriate size for your users.
Read 17 tweets
4 Aug
⚡ Every Web Developer should know how to create next-gen image formats

Serving your images in next-gen formats is crucial to ensure your performance is fantastic and loads fast for any of your users.

👇 Learn how to create images in the next-gen format in seconds
1️⃣ What are next-gen formats?

Next-gen formats are image formats such as
- WebP
- AVIF
- JPEG 2000
- JPEG XR

We will focus on WebP as this has the best support across all browsers and is most used!
2️⃣ What is WebP?

WebP is a next-gen image format published by google in 2010. It creates lossless images that are 26% smaller than PNG's and lossy images 25-34% smaller.

In reality, I have seen over 40% smaller sizes already.

And WebP supports transparency! ⚡

👇
Read 15 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(