Stockio

How to Optimize LCP: Fix Hero Discovery and Render Delay

Break Largest Contentful Paint into measurable phases, prioritize the actual hero resource, and remove discovery and render delays without overusing preloads.

By Marcus Bell

Front-End Engineer ·

On this page

A compressed hero image can still appear late. The browser may discover it only after JavaScript runs, assign it insufficient priority, or download it promptly but wait for the page to reveal it. Largest Contentful Paint work starts by identifying the actual candidate and measuring the delay around it.

Identify the real LCP element

LCP describes when the largest eligible content element becomes visible in the viewport. It is not necessarily your hero illustration: a headline, poster image, or product photograph can win on different screens. Aim for 2.5 seconds or less at the 75th percentile of visits, separating mobile and desktop results. The LCP documentation explains candidate selection and measurement boundaries.

Inspect representative pages at the viewport sizes your audience uses. Record the candidate element, its resource URL if applicable, and whether consent banners or promotional variants alter the layout. Do not optimize a desktop photograph if mobile users are actually waiting for a text block.

Use the image resizer calculator to check intended display dimensions and aspect ratios for an image candidate. This helps avoid transferring needlessly large files, but dimension calculations do not reveal discovery or rendering delays. Treat sizing as one part of the investigation, not the entire strategy.

Divide the timeline into four phases

For an image-based LCP, examine time to first byte, resource load delay, resource load duration, and element render delay. These phases create an optimization map: server response, discovery and priority, transfer, and visibility. The LCP optimization guide provides the framework for interpreting them.

Time to first byte ends when the browser receives the document's first byte. Resource load delay is the gap before the image request begins. Resource load duration covers its download. Element render delay runs from resource completion until the element can actually paint. A smaller file mostly targets the third phase, so it cannot solve every slow result.

Write down each phase from a representative trace before changing code. For example, if the image finishes early but remains hidden during app initialization, replacing JPEG with another format may produce little improvement. Investigate the visibility condition instead.

Compare repeated tests rather than one lucky run. Warm connections, caches, geographic distance, and server load all influence timing. Capture both a cold navigation and a repeat visit, labeling them clearly. Field data remains the final check because a controlled lab test cannot reproduce the full range of users and devices.

Make the critical resource discoverable

Prefer an ordinary image element in the initial HTML for a meaningful hero. That allows the browser's preload scanner to discover the source without waiting for client rendering or a stylesheet. Do not lazy-load an image that is likely to become LCP.

<img
src="/images/workspace-hero-1280.webp"
srcset="/images/workspace-hero-640.webp 640w,
        /images/workspace-hero-1280.webp 1280w"
sizes="(max-width: 700px) 100vw, 1100px"
width="1280"
height="720"
fetchpriority="high"
alt="A workspace showing the project dashboard"
>

Here fetch priority is a hint, not a command that overrides every scheduling decision. Reserve high priority for a genuinely important resource. Marking every image high priority destroys the distinction and can intensify competition with stylesheets and other necessary downloads.

If a CSS background must remain the hero, consider preloading its exact resource from the document head. First verify that the preload matches the URL and request mode actually used. Responsive art direction needs special care; an incorrect preload may download an image the viewport never displays.

Check the Network panel after implementation. Confirm that discovery moves earlier and that only the selected image variant downloads. Refer to the existing responsive image pipeline guide for source selection details rather than rebuilding the whole image process during a timing fix.

Remove unnecessary render gates

An image can be downloaded yet unpainted because an ancestor is hidden, an entrance effect delays visibility, or application state waits for unrelated data. Audit these render gates explicitly. A hero should not depend on a recommendation API or analytics initialization unless that dependency is essential to its content.

For text LCP, inspect stylesheet availability and the font behavior of the actual heading. The right fix depends on the candidate, so image-specific techniques are not universal. Avoid adding speculative image preloads when the slow element is text.

Separate content availability from enhancements. Render the primary title and hero with the initial response where the architecture supports it, then enhance interactive controls independently. This is a targeted delivery decision, not a requirement to migrate frameworks.

Look for a large amount of layout work after resource completion. Hidden carousels, deeply nested wrappers, and synchronous component updates can delay painting. Simplifying the visible hero can help, but removing necessary accessibility information is not an acceptable shortcut. Keep headings meaningful and provide alternative text based on the image's purpose.

Validate priority and experience together

Use MDN's preload documentation to verify hint behavior before introducing additional preloads. Each hint should have a measured reason, an owner, and a removal condition if the page design changes. Forgotten hints often outlive the assets they were meant to accelerate.

Test the page under constrained bandwidth and CPU conditions, then inspect real-user results after deployment. Verify that prioritizing the hero did not push out essential CSS or delay the first usable control. Check different viewport widths, localized headlines, and pages without images.

Keep the design system informed of the result. A landing-page hero can remain visually ambitious while exposing its primary content early. Document which asset is expected to be the LCP candidate for each template and which fields editors may safely change.

Finally, track phase-level regressions. A candidate switch or a newly introduced render gate can make a previous optimization irrelevant. Review field percentiles alongside trace samples and deployment notes, rather than treating one successful audit as permanent certification.

Key takeaways

  • Identify the actual LCP candidate for each viewport.
  • Measure discovery, transfer, and render delay separately.
  • Keep likely LCP images eager and readily discoverable.
  • Use priority hints selectively and verify request behavior.
  • Remove unnecessary visibility dependencies before adding more preloads.
Featured sponsor

Reach designers & developers at work

Put your product next to the tools people use every day. One sponsor per placement, no tracking pixels.

Become a sponsor

Keep reading

Related articles

More in Performance & SEO
Performance & SEO

10 Best Image Optimization Tools

Compare ten image optimisation tools for shrinking photos, preparing web graphics, and automating delivery, with practical notes on format support, workflow fit, and quality trade-offs.

Includes: Image resizerMarcus BellMarcus Bell
Performance & SEO

Lazy Loading Images Without Hurting LCP or SEO

Choose what to lazy-load, preserve native image discovery, reserve layout space, and test below-the-fold content without delaying the page's most important visual.

Includes: Image resizerEthan ClarkeEthan Clarke
Performance & SEO

Responsive Images With srcset: Automate Your Pipeline

Create a repeatable responsive image pipeline that selects useful widths, generates modern formats, and delivers sharp images without wasting bandwidth.

Includes: Image resizerEthan ClarkeEthan Clarke
Icons & Illustration

10 Best Character and Avatar Generators

Compare ten avatar and character makers for profile photos, games, presentations, and product mock-ups, with practical notes on customisation, export options, and choosing a style.

Includes: Image resizerMateo FernándezMateo Fernández
Branding & Business

10 Best Brand Mockup Sites for Presenting Your Work

Compare ten mockup sites for placing a logo or brand design on packaging, screens, and everyday objects, plus practical guidance for choosing realistic scenes and sharing polished previews.

Includes: Image resizerArjun RamanArjun Raman
Branding & Business

10 Best Social Media Scheduler Apps for Creators

Compare ten social media schedulers for solo creators and small teams, from visual planning to analytics, and learn which features matter before you move your posting routine.

Includes: Image resizerPiotr KowalskiPiotr Kowalski