How to Improve Largest Contentful Paint (LCP) Under 2.5s
Concrete fixes to improve Largest Contentful Paint (LCP): hero image optimization, preloading, and faster server response — with real before/after numbers.
Introduction
LCP is the metric most likely to tank your Core Web Vitals score, and it's also the one with the clearest, most fixable causes. Google considers 2.5 seconds or faster "good" — but most sites blow past that because of a handful of repeat offenders: an unoptimized hero image, a render-blocking resource, or a slow server response. Here's exactly how to improve LCP, with concrete before/after fixes you can apply today.
First, Confirm What's Actually Causing Your LCP
Before optimizing anything, you need to know what your LCP element actually is — the largest visible piece of content the browser is waiting to paint. It's usually one of three things: a hero image, a large block of text (often a heading rendered with a custom web font), or a background image applied via CSS. Guessing which one it is and optimizing the wrong asset is the single most common wasted effort in LCP work — so identify the actual element first.
Fix 1: Optimize the Hero Image
If your LCP element is an image — which it is on the large majority of sites — this is where most of your gains live.
Before: A 2.4MB PNG hero image, served at its original 4000px width and scaled down in the browser with CSS, taking 3.8 seconds to fully paint.
After:
- Convert to WebP or AVIF (typically 25–50% smaller than an equivalent-quality JPEG or PNG).
- Serve the image at the actual display size, not full original resolution — a 1200px-wide hero doesn't need a 4000px source file.
- Use srcset to serve appropriately sized images per device.
- Compress at quality ~80, which is visually near-identical to 100 but meaningfully smaller.
Result: The same visual hero image drops from 2.4MB to roughly 300–400KB, and LCP falls from 3.8s to around 1.6s — comfortably under the 2.5s threshold.
Fix 2: Preload the LCP Resource
By default, the browser doesn't know your hero image is important until it parses far enough into the HTML/CSS to discover it — which can be well after the page starts loading. A <link rel="preload"> tag tells the browser to fetch that specific resource immediately, in parallel with everything else.
Before:
<img src="hero.webp" alt="Product hero image">
The browser discovers this image only after parsing the surrounding HTML and any blocking CSS — a delay that can add hundreds of milliseconds before the download even starts.
After:
<link rel="preload" as="image" href="hero.webp" fetchpriority="high">
<img src="hero.webp" alt="Product hero image">
Combined with fetchpriority="high", this tells the browser: fetch this now, ahead of lower-priority resources. This single change commonly shaves several hundred milliseconds off LCP with zero visual or design changes.
Fix 3: Reduce Server Response Time (TTFB)
LCP can't start until the browser has the HTML to parse, and it can't get the HTML until your server responds. A slow Time to First Byte pushes back every downstream metric, including LCP — no amount of image optimization fixes a server that takes 1.5 seconds just to respond.
Common causes and fixes:
- Unoptimized database queries on dynamic pages — add indexes, cache expensive queries.
- No caching layer — introduce a CDN or edge cache for static and semi-static content so requests don't hit your origin server every time.
- Server-side rendering overhead — for frameworks doing heavy SSR work per request, consider static generation or incremental caching for pages that don't need to be rendered fresh every time.
- Slow or distant hosting — a server geographically far from your users adds network latency before any processing even starts.
Before: TTFB of 1.2 seconds due to an uncached database query running on every homepage request.
After: Adding a 5-minute cache on that query drops TTFB to roughly 150–200ms — often the single biggest LCP win available, because it improves every page on the site at once, not just one.
Fix 4: Eliminate Render-Blocking Resources Above the LCP Element
CSS and synchronous JavaScript loaded in the <head> block the browser from painting anything until they've downloaded and executed — including your LCP element, even if the image itself downloaded instantly.
Before: A large, unminified CSS file loaded synchronously, blocking first paint for 600ms before the browser even starts rendering the hero section.
After: Inline the small amount of critical, above-the-fold CSS directly in the <head>, and load the rest asynchronously or deferred. This lets the browser paint the visible hero section immediately, without waiting on styles for content the visitor hasn't scrolled to yet.
Putting It Together: A Realistic Before/After
A typical unoptimized landing page might show:
- Hero image: 2.4MB PNG, not preloaded → 1.8s of that delay alone
- TTFB: 900ms from an uncached query
- Render-blocking CSS: 400ms before first paint
- Total LCP: ~3.9 seconds
After applying all four fixes:
- Hero image: 350KB WebP, preloaded with fetchpriority="high"
- TTFB: 180ms with query caching
- Critical CSS inlined, rest deferred
- Total LCP: ~1.4 seconds
None of these fixes individually requires a rebuild — they're targeted, specific changes, which is exactly why LCP is one of the more satisfying Core Web Vitals to improve.
How BugViso Pinpoints Your LCP Element
The hardest part of LCP optimization isn't applying the fixes above — it's knowing which element and which cause actually apply to your page. BugViso measures LCP directly via the official web-vitals library and identifies the specific element responsible for it, along with a breakdown of how much of the delay comes from server response time, render-blocking resources, and the resource itself — so you're not guessing whether to focus on your image, your server, or your CSS.
Conclusion & Call to Action
Getting LCP under 2.5 seconds almost never requires a full rebuild — it requires finding the one or two actual bottlenecks (usually an unoptimized hero image or a slow server response) and fixing those specifically. The fixes above cover the overwhelming majority of real-world LCP problems.
Run a free BugViso scan to see your exact LCP element, your current score, and precisely which of these fixes will move the needle most for your site.
See where your site stands
Run a free BugViso audit for SEO, speed, accessibility and AI search readiness — with fixes you can ship today.