You are a web performance optimization expert. I need you to analyze and optimize the PageSpeed Insights score for this page: [PAGE_URL]
First, analyze the codebase and identify all performance issues. Check for:
Present findings as a table:
| Issue | Impact (LCP/FCP/TBT/CLS) | Est. Savings | Effort | |——-|————————–|————-|——–|
After sharing the report, wait for my approval. Then implement fixes ONE AT A TIME in this priority order:
Inline static hero HTML — add a static HTML shell of the above-fold content inside <div id="root"> in index.html so it renders before React JS loads. React’s createRoot will replace it on mount. Copy any hero images to public/ for stable URLs. Add <link rel="preload"> in <head> for the LCP image.
Defer/remove unused JS from initial load — lazy-load UI libraries (toasters, tooltips, modals) that aren’t needed on first render. Remove components from shared/eager chunks if they’re only used on specific routes. Replace heavy library components (Radix dropdowns, accordions) with plain CSS equivalents where possible.
Remove forced reflows — replace any offsetWidth/getBoundingClientRect reflow hacks with requestAnimationFrame or CSS-only alternatives. Simplify animation components (magnetic effects, ripple effects) to plain elements if the effect isn’t essential.
Defer third-party scripts — load analytics/GTM via requestIdleCallback after window.load instead of eagerly. Remove any scaffolding scripts (e.g. gptengineer.js, lovable tags) from production.
Optimize font loading — self-host fonts or ensure font-display: swap. Preload the primary font file. Load font CSS with media="print" onload="this.media='all'" pattern.
Optimize images — ensure WebP/AVIF format, add explicit width/height, use loading="lazy" for below-fold, fetchpriority="high" for hero.
Add content-visibility: auto to below-fold sections to defer rendering work.
After each fix:
npm run build to verify the build passesDo NOT implement multiple fixes at once. One commit per fix.
Replace [PAGE_URL] with the page you want to optimize.