Build and Launch a Website with AI
AI website slow on mobile? Fix images, fonts and scripts with PageSpeed Insights (2026)
Diagnose a slow AI-built website with mobile PageSpeed Insights. Separate field and lab data, fix the identified image, font or script bottleneck, then verify the deployed site and its key features.

A phone visitor waits for the main picture, taps a menu that responds late, then loses their place when the layout shifts. Start with PageSpeed Insights, identify the resource or task behind the delay, and ask your AI editor to change that part of the project. Check one group of changes at a time.
This guide is for a published portfolio, personal website or small web tool. Have the production URL, access to the project and a way to deploy it again. The examples are instructions, not measured results from a particular website.
Open PageSpeed Insights, enter the full production URL and view the mobile report. Test a representative detail page as well as the homepage. A fast development preview does not establish that the public site is fast.
Save the URL, test time, deployment version and the element identified as the largest content in the first screen. Run three checks using the same URL and device mode. Keep the individual metrics and compare a typical result, rather than choosing the best run from each set.
The report contains two different kinds of evidence:
| Evidence | What it describes | After a deployment |
|---|---|---|
| CrUX field data | Experiences of eligible real Chrome visitors over a rolling 28 days | A code change does not instantly replace the historical window |
| Lighthouse lab diagnostics | This simulated load under the test conditions | Run again to investigate changes; scores can vary |
Check whether field data refers to this URL or the entire origin. Insufficient field data does not mean zero visitors. Google explains the two data sources.
Read the metrics before chasing the overall performance score.
| Metric | Visitor symptom | Good threshold |
|---|---|---|
| LCP: Largest Contentful Paint | The main image or large text block appears late | At most 2.5 seconds |
| INP: Interaction to Next Paint | A tap or click gets a late visual response | At most 200 milliseconds |
| CLS: Cumulative Layout Shift | Content moves as resources arrive | At most 0.1 |
The Core Web Vitals guidance evaluates these at the 75th percentile, with mobile and desktop visits considered separately. Total Blocking Time, or TBT, in a loading lab test can help investigate main-thread work. It is not a replacement measurement for real-user INP.
For a portfolio whose main picture arrives late, inspect the reported LCP element first. It may also be a heading or another text block. For an unresponsive menu, investigate the interaction and the JavaScript involved.
Find the LCP resource in the report, or filter image requests in your browser's Network panel. Look at the actual transfer size and request timing. Displaying a large original at a smaller CSS width does not reduce the original download.
Export an appropriate size and compare formats such as WebP or AVIF with the existing file. Check both quality and bytes. A photograph, transparent illustration and text-heavy screenshot may need different choices.
This example assumes a hero that spans the viewport width. First create three real 16:9 files: 640×360, 960×540 and 1280×720. Publish them at the corresponding /images/ paths. The filenames are examples; copying the markup cannot create the image files.
<img
src="/images/hero-1280.webp"
srcset="/images/hero-640.webp 640w,
/images/hero-960.webp 960w,
/images/hero-1280.webp 1280w"
sizes="100vw"
width="1280"
height="720"
alt="Web design project featured on a portfolio homepage"
loading="eager"
fetchpriority="high"
style="display:block;width:100%;height:auto"
>
The browser chooses a candidate using factors including viewport width and pixel density; a phone will not always select the smallest file. Adjust sizes for a half-width column or a maximum-width layout. The width and height provide an aspect ratio so the layout can reserve space.
Use this treatment for the confirmed critical first-screen image. The LCP optimization guide advises against lazy-loading it. High fetch priority is a hint for a critical resource, not a setting for every picture. Consider loading="lazy" for images farther down the page.
If the project already has an image component or resizing service, ask the AI to use that system instead of installing another pipeline. Adapt root-relative URLs if the site is hosted under a subdirectory.
Remove unused font families and weights before adding more loading hints. Check how much font data a decorative heading requires, and keep the characters your published languages actually need.
font-display: swap can show fallback text sooner, but the eventual font replacement can still shift the layout. Choose compatible fallback metrics and check line breaks, button widths and CLS before and after the font arrives. Do not preload every font. Font best practices describe this visibility and layout tradeoff.
Reserve an appropriate aspect ratio for pictures and space for video, embeds and advertising slots. A narrow phone layout can reveal jumps that are easy to miss on a desktop screen.
Record opening the page, tapping the menu and switching content in the browser's Performance panel. Ask the AI to identify the file and feature responsible for long main-thread tasks.
A chart, editor or chat panel below the fold may be loaded when needed. Review dependencies before changing when analytics, authentication or form code initializes. Test those features afterward. Removing a working feature just to raise a score is not a successful optimization.
INP concerns the visual response to an interaction. A button that immediately shows a pending state while its API request stalls needs a separate investigation of that request; a responsive first paint does not establish that the complete transaction is fast.
If the HTML document itself arrives late, investigate time to first byte, redirects, backend work and the route from your audience's region. Choose caching, server changes or hosting location based on that evidence. More VPS memory does not make an oversized static image smaller.
Save a recoverable version using the website backup and restore checklist. Attach the relevant report details and resource URLs, then fill in this request:
Investigate mobile performance in this existing website project.
Production URL: [fill in]
Deployment version: [fill in]
Test date, device mode and three runs: [fill in]
LCP element and resource URL, or text element: [fill in]
Main diagnostic findings: [fill in]
Explain the main bottleneck and list the files you plan to change.
Start with confirmed first-screen resources; avoid unrelated redesigns.
Image candidates must be real files, and sizes must match the layout.
Preserve forms, login, analytics and navigation; explain timing changes.
For each group of edits, provide validation and a recovery method.
List completed edits and remaining checks. Mark untested claims untested.
Handle images first when they are the identified cause. Validate that change before moving on to fonts or scripts, so regressions remain easier to trace.
For a React + Vite project, follow the production deployment guide. Confirm that the phone is receiving the new version before comparing measurements.
- Open the production domain on a real phone and a normal network; visit the homepage and an internal page.
- Check that replacement images load successfully, have the intended crop and do not return 404 errors.
- Use the menu and login entry, and submit a removable test form entry. Check text, button layout and unexpected movement.
- Repeat three lab runs with the same URL and device mode. Keep each LCP, CLS, TBT and performance score, then compare typical results.
- If analytics loading changed, use the traffic and realtime verification steps to confirm collection still works as intended.
- Follow field metrics, including INP, when sufficient real-user data is available. Allow for the rolling reporting window.
Keep a short change log with the date, deployment ID, changed resources, before-and-after runs, functional checks and recovery option. Record unavailable field data as unavailable; do not fill that gap with lab numbers.
Why is desktop fast while mobile performs poorly? The test conditions differ, and script execution may be more expensive on the simulated mobile device. Compare like with like, then check a phone representative of your audience.
Do I need a score of 100? Prioritize timely main content, responsive interactions, stable layout and working features. A single score does not promise better rankings, traffic or revenue.
Why is LCP still slow after compression? The browser may discover the resource late, wait for JavaScript to insert it, or wait for HTML or fonts. Inspect which part of the LCP timeline still contains the delay.
Documentation checked on 2026-11-23. Actual gains depend on the site, device, network and deployed changes; no improvement figures are claimed for the examples.