Reputation: 31
I am working on an Angular application, and Lighthouse is reporting a very high Largest Contentful Paint (LCP) time for my app. Here are the details:
LCP Element:
<h1 class="maintitle_withicon" style="font-size: 32px; font-weight: 700; color: #333;">
home Welcome back, Case Worker30
</h1>
LCP Time: 23,150 ms
Description: The tag contains the text "Welcome back, Case Worker30", and Lighthouse identifies it as the LCP element. I’ve already adjusted its CSS properties (e.g., optimized font size, weight, and color) to simplify rendering.
Steps Taken
Font Optimization:
Added font-display: swap to all @font-face rules. Preloaded critical fonts used in the tag. CSS Optimization:
Reduced visual complexity (e.g., no heavy shadows). Verified that the styles render efficiently across browsers. Lazy Loading:
Issues Despite the above optimizations, the LCP time remains excessively high.
Questions
Upvotes: 0
Views: 395
Reputation: 51
I think it’s worth restating what LCP is: this Web Vital measures the largest element rendered on the screen before user interaction. Given that you are running the Lighthouse test, it reports the largest component of the viewport—which happens to be the H1 tag. However, it may not be a problem with the element itself but rather with the preceding application loading steps.
To better understand the flow, I would suggest measuring (and sharing here) TTFB and Element Render Delay. Resource load delay and duration should be zero since it’s a text element.
I would expect that Element Render Delay will be bigger than TTFB; thus, to optimize LCP, you would need to focus on that.
The best way to improve it would be to debug which steps are happening before the H1 element shows up. Those might include:
• Loading application code
• Fetching data through API
If that’s the case, consider:
• Splitting application code into chunks, loading the part that’s needed to render the initial UI first
• Using pagination or decreasing server latency to speed up data load
Please share the performance report from the developer tools; we might be able to provide more specific recommendations.
Also, I would recommend reading this article: https://web.dev/blog/common-misconceptions-lcp
Upvotes: 0