Largest Contentful Paint is the Core Web Vital that determines how fast your page feels to users — and it’s the one Google weighs most heavily in its Core Web Vitals ranking signal. Despite its importance, most websites fail to hit the “Good” threshold (<2.5 seconds) at the 75th percentile of user experiences, often due to a handful of fixable issues that compound into significant performance delays.
This guide covers LCP optimization from first principles: how to identify your LCP element, understand the full causal chain that determines its render time, and apply the specific interventions that move field data into the Good range.
The LCP Critical Rendering Path
How LCP Time Accumulates
LCP time is not simply “how long it takes to download the image.” It’s the sum of delays across the entire rendering pipeline from URL request to element paint:
- DNS lookup + TCP connection + TLS negotiation: Before the browser sends a single byte, it must resolve the domain, establish a connection, and complete TLS handshake (for HTTPS). Combined: 50–300ms on first visit.
- Server response time (TTFB): Time from request sent to first byte received — server processing time + network round trip.
- HTML download and parse: Receiving and parsing the HTML document to build the DOM.
- CSS download and parse: Render-blocking stylesheets must be downloaded and parsed before the browser can determine how to display content.
- LCP resource discovery: The browser discovers the LCP element (image src or background-image URL) during CSS/HTML parsing.
- LCP resource download: The LCP image (or font for text LCP) downloads.
- LCP element render: Browser paints the LCP element to screen.
Every step in this chain adds to total LCP time. Optimization addresses each step — the earlier in the chain the optimization occurs, the more it can reduce total LCP.
Identifying Your LCP Element
Before optimizing, confirm what your actual LCP element is on each page template. Three methods:
- Web Vitals Chrome extension: Click the extension while on your page; it highlights the LCP element with an overlay and shows the LCP time
- Chrome DevTools Performance panel: Record a page load; find the “LCP” marker in the timeline; the “Related Node” in the LCP event details identifies the element
- PageSpeed Insights: The “Opportunities” and “Diagnostics” sections identify the LCP element by type and URL
LCP element varies by page template — check your homepage, key landing pages, product pages, and blog post template separately. Each may have a different LCP element requiring different optimization approaches.
Step 1: Optimize Server Response Time (TTFB)
TTFB Baseline and Targets
Google’s TTFB threshold: Good = under 800ms; Needs Improvement = 800ms–1800ms; Poor = over 1800ms. For LCP optimization, target TTFB under 600ms — the headroom you save from TTFB reduction directly reduces LCP.
TTFB Optimization Approaches
CDN implementation (highest impact for most sites): A Content Delivery Network serves your pages from edge nodes geographically close to users — reducing the network distance component of TTFB from hundreds of milliseconds (server in US serving user in Asia) to tens of milliseconds (CDN node in same region as user). For static and cached pages, CDN is typically the single highest-impact TTFB optimization.
Server-side caching: Dynamic pages generated from database queries on every request have the slowest TTFB because of processing time. Implement full-page caching (WordPress: WP Rocket, Cloudflare Page Cache; custom apps: Redis or Varnish) to serve pre-built HTML for most requests, reducing server processing to near-zero.
Database query optimization: If your page requires uncacheable dynamic generation (personalized content, real-time inventory), identify and optimize slow database queries. Use EXPLAIN in MySQL to analyze query execution plans; add database indexes for queries filtering on non-indexed columns.
Hosting infrastructure upgrade: Shared hosting and low-tier cloud instances have limited CPU and I/O that caps maximum TTFB performance. Upgrading to adequate infrastructure is sometimes the bottleneck for TTFB improvement.
Step 2: Eliminate Render-Blocking Resources
What Are Render-Blocking Resources?
Render-blocking resources are CSS and JavaScript files that the browser must download and process before it can render any visible content. While the browser is waiting for these files, the page appears blank to users — LCP cannot occur until render-blocking is resolved.
Critical CSS (styles for above-the-fold content) must be processed before first render — this is unavoidable. But most sites load far more CSS and JavaScript as render-blocking than is necessary for initial rendering.
CSS Optimization
Inline critical CSS: Extract the CSS rules needed to render above-the-fold content (critical CSS) and inline them in the HTML <head>. Load the full CSS stylesheet asynchronously. This allows the browser to begin rendering immediately using inlined critical CSS while the full stylesheet loads in the background.
<head>
<!-- Critical CSS inlined -->
<style>
/* Only styles needed for above-the-fold content */
header { ... }
.hero { ... }
h1 { ... }
</style>
<!-- Full CSS loaded asynchronously -->
<link rel="preload" href="/styles.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="/styles.css"></noscript>
</head>
Eliminate unused CSS: Most sites load significantly more CSS than any single page uses. Tools like PurgeCSS or browser DevTools Coverage panel identify unused CSS rules. Removing unused CSS reduces download and parse time.
JavaScript Optimization
JavaScript in the <head> without defer or async attributes blocks HTML parsing and rendering. The fix:
- Add
deferattribute to scripts that don’t need to execute before page content is visible (analytics, chat widgets, non-critical functionality) - Add
asyncattribute to independent scripts that can load in any order - Move non-critical scripts from
<head>to end of<body> - Consider loading third-party scripts (especially heavy ones like intercom, Drift, or Google Tag Manager) only after LCP has occurred
Step 3: Preload the LCP Resource
The Preload Directive
This is often the single highest-impact LCP optimization for image-based LCP elements. Without preloading, the browser discovers the LCP image URL only after parsing HTML and CSS — a delay of 300–800ms in typical page loads. Preloading closes this discovery gap by telling the browser about the LCP resource in the earliest HTML processed.
<head>
<link rel="preload" as="image" href="/hero-image.webp"
fetchpriority="high"
imagesrcset="/hero-400.webp 400w, /hero-800.webp 800w, /hero-1200.webp 1200w"
imagesizes="(max-width: 600px) 400px, (max-width: 900px) 800px, 1200px">
</head>
The fetchpriority="high" attribute (supported in modern browsers) signals that this resource should be downloaded before other resources of the same type, ensuring the LCP image doesn’t queue behind other images or resources.
Preload Cautions
- Preload only the LCP element — preloading multiple resources unnecessarily creates bandwidth competition
- Ensure the preloaded URL exactly matches the URL the browser would naturally discover (same file format, same URL structure)
- For responsive images, use imagesrcset/imagesizes in the preload to match the srcset in your
<img>tag — this ensures the right size image is preloaded for each viewport - If your LCP image URL is dynamic (varies by user or page context), preloading may not be possible — focus on other optimizations instead
Step 4: LCP Image Optimization
Format Selection
| Format | Browser Support | Compression | Best For |
|---|---|---|---|
| AVIF | 90%+ (Chrome, Firefox, Safari) | Excellent (40-50% smaller than WebP) | Photos, complex images |
| WebP | 95%+ | Very good (25-35% smaller than JPEG) | Photos, images with transparency |
| JPEG | 100% | Good baseline | Fallback for unsupported browsers |
| PNG | 100% | Poor for photos (lossless) | Only for images requiring lossless quality |
| SVG | 100% | Excellent for simple graphics | Icons, logos, simple illustrations |
Serve AVIF with WebP fallback and JPEG as the baseline fallback using the <picture> element:
<picture>
<source srcset="/hero.avif" type="image/avif">
<source srcset="/hero.webp" type="image/webp">
<img src="/hero.jpg" alt="Hero description" width="1200" height="630"
fetchpriority="high" loading="eager">
</picture>
Image Sizing and Compression
- Serve images at the largest rendered size — don’t serve a 2400px image for a 1200px display slot
- Use responsive images with
srcsetto serve appropriately-sized images for each viewport - Compress images with Squoosh, ImageMagick, or CDN-level image optimization (Cloudflare Images, Cloudinary, Imgix)
- Target LCP image file size under 100KB — ideally under 60KB for optimal load performance
- Confirm LCP image is explicitly declared
loading="eager"(never lazy) — lazy loading the LCP element dramatically delays it
Step 5: Font Loading Optimization (Text LCP)
When the LCP element is text rendered in a custom web font, font loading delay is the primary cause of slow LCP. Optimizations:
- Preload the web font file for the LCP text:
<link rel="preload" href="/fonts/main-font.woff2" as="font" type="font/woff2" crossorigin> - Use
font-display: swapin your @font-face declarations to show system font text immediately while the custom font loads (preventing invisible text delay) - Self-host web fonts rather than loading from Google Fonts or other third-party servers — eliminates DNS lookup + connection time for font domain
- Subset fonts to include only characters used on the page (particularly useful for non-Latin scripts)
Over The Top SEO conducts Core Web Vitals audits and implements technical performance optimizations that move field data into Google’s ‘Good’ thresholds. Contact us for a Core Web Vitals assessment and optimization plan.
Measuring LCP Improvement
Before/After Measurement Protocol
To accurately measure LCP improvement after implementing optimizations:
- Lab measurement: Use PageSpeed Insights or Lighthouse before implementation to establish baseline. Run immediately after implementation to confirm lab improvement. Run on both mobile and desktop settings — mobile typically has worse scores and matters more for Google’s signals.
- Field data: Wait 28 days after implementation for Google Search Console Core Web Vitals report to reflect updated field data (CrUX data updates with a lag). Compare LCP distribution before and after in the URL-level report.
- Ranking changes: Monitor ranking positions for target keywords 4–8 weeks after implementation — ranking impact from LCP improvement is not immediate and may be subtle.
Successful LCP optimization typically follows this sequence: server TTFB → render-blocking elimination → preloading → image optimization. Addressing in this order maximizes the compounding impact of each subsequent optimization.