More about LCP - Deepstash

More about LCP

This approximates when the main content of the page is visible to the users. 

The elements that are taken into consideration for Largest Contentful Paint: 

  • <img> elements
  • <image> elements inside an <svg> element
  • <video> elements (the poster image is used)
  • An element with a background image loaded via the   
Block-level

In the future, additional elements might be added, like <svg> and <video>

Extra info: 

LCP

4 STASHED

MORE IDEAS FROM THEARTICLE

Causes: 

  • Slow server response times
  • Render-blocking JavaScript and CSS
  • Resource load times
  • Client-side rendering

For improvements, some relevant techniques:

Apply instant loading with the PRPL pattern
Optimizing the Critical Rendering Path
Optimize your CSS
Optimize your Images
Optimize web Fonts
Optimize your JavaScript

4 STASHED

  • Prefer transform animations to animations of properties that trigger layout changes. Animate transitions in a way that provides context and continuity from state to state.

More info: 

here

4 STASHED

Try to diagnose the root cause of long tasks, using 

What is causing my long tasks?

In general, the most common causes are:

  • Unnecessary JavaScript loading, parsing or execution. This means the main thread is doing more work than it supose to do -> try reducing JS payloads with code splitting, removing unused code and efficiently loading third-party JavaScript
  • Inefficient JS statements -> avoid selectors that returns 2000 nodes (e.g. document.querySelectorAll('a') ) and refactor to have a more specific one.

4 STASHED

While anything you do to improve page load speed will improve your Speed Index score, addressing the following should have a particularly big impact:

Minimize main thread work
Reduce JavaScript execution time
Ensure text remains visible during webfont load

4 STASHED

        Name - Weight in score - Summary

  1. First Contentful Paint (FCP) - 10% - Time to paint the first text or image
  2. Time to Interactive (TTI) - 10% - Necessary time for the app to become fully interactive (responding within 50ms from user interaction)
  3. Speed Index (SI) - 10% - How fast the content inside the page is visible populated
  4. Total Blocking Time (TBT) - 30% - Sum of all periods between FCP and TTI, when the task exceeds 50ms
  5. Largest Contentful Paint (LCP) - 25% - Time for the largest image or text to be painted
  6. Cumulative Layout Shift (CLS) - 15% - Movement of visible elements

4 STASHED

1 LIKE

PRPL is an acronym that describes a pattern used to make web pages load and become interactive, faster:

  • Push (or preload) the most important resources.
  • Render the initial route as soon as possible.
  • Pre-cache remaining assets.
  • Lazy load other routes and non-critical assets.

4 STASHED

TBT measures the total amount of time that a page is blocked from responding to user input, such as mouse clicks, screen taps, or keyboard presses. The sum is calculated by adding the blocking portion of all 

long tasksFirst Contentful PaintTime to Interactive

4 STASHED

1 LIKE

Very important for this part is the font load time. For faster load, it can be used the font-display: swap. This will make the site to render the default font and when the loading is done, the font will be changed. Also, you can preload the fonts. 

4 STASHED

CLS is a measure of the largest burst of layout shift scores for every 

unexpected

How to improve:

  • Always include size attributes on your images and video elements, or otherwise reserve the required space with something like
CSS aspect ratio boxes
  • Never insert content above existing content, except in response to a user interaction. This ensures any layout shifts that occur are expected.

4 STASHED

It measures how long it takes a page to become fully interactive. A page is considered fully interactive when:

  • The page displays useful content, which is measured by the  
  • Event handlers are registered for most visible page elements, and
  • The page responds to user interactions within 50 milliseconds.

To improve this metric, you should consider 

reducing JavaScript payloads with code splittingapplying the PRPL pattern

Also, other things that can be helpful: 

minimize main thread work

and 

reduce JavaScript execution time

4 STASHED

 Some of the values are calculated based on 

data from the HTTP Archive

If you don't have a very specific reason to optimise only one of the metrics, the best approace would be to check the opportunities mentioned in the Lighthouse report and read an in-depth presentation 

here

4 STASHED

Deepstash helps you become inspired, wiser and productive, through bite-sized ideas from the best articles, books and videos out there.

GET THE APP:

RELATED IDEAS

What Is On-Page SEO?

On-page SEO, also known as on-site SEO, is the practice of optimizing the content on your page (both the written word and the HTML source code) to make it as discoverable as possible.
You want to make it easy for Google, Bing, and other search engines to understand the material on the page to pair it with relevant search queries.

An on-page SEO strategy essentially organizes the content on the page so that search engine crawlers going over the material know what they’re looking at and can categorize the page appropriately.

5 STASHED

1 LIKE

What is an SEO Audit?

SEO audit is the process of identifying issues that could prevent your site from ranking on Google and other search engines.

Common reasons for SEO audit:

  • You just landed a new SEO client and are putting together a growth strategy.
  • You started a new job and, like the above, are putting together a strategy.
  • You bought a website and want to figure out your next steps.
  • You experienced a drop in organic traffic and need to discover why.
  • Part of your ongoing SEO strategy includes regular audits to allow you to find and fix issues quickly (we recommend quarterly).

5 STASHED

Testing in React Native

As your codebase expands, small errors and edge cases you don’t expect can cascade into larger failures. Bugs lead to bad user experience and ultimately, business losses. One way to prevent fragile programming is to test your code before releasing it into the wild.

There is more value in testing than you might realize. One of the best ways to fix a bug in your code is to write a failing test that exposes it. Then when you fix the bug and re-run the test, if it passes it means the bug is fixed, never reintroduced into the code base.

7 STASHED

4 LIKES