The Three Metrics
LCP
Largest Contentful Paint. Target < 2.5s.
INP
Interaction to Next Paint. Target < 200ms.
CLS
Cumulative Layout Shift. Target < 0.1.
- LCP — how fast the main content renders
- INP — how responsive the page feels to taps and clicks
- CLS — whether content jumps around as the page loads
Step 1: Measure First
Never guess. Before touching anything, get a baseline.- Hiveku SEO Audit
- PageSpeed Insights
- Chrome DevTools
Use the built-in AI SEO Site Audit. It runs Lighthouse against your live site and returns Core Web Vitals scores with prioritized fixes.
LCP Improvements
The hero section usually drives LCP. Focus there first.- Optimize images — convert to WebP or AVIF, serve at correct dimensions, always set
widthandheightattributes - Preload the hero image —
<link rel="preload" as="image" href="/hero.webp">in<head> - Remove render-blocking JS — defer third-party scripts with
asyncordefer - Use a CDN — Hiveku deploys to CloudFront automatically, but custom domains need proper cache headers
- Reduce server response time — slow APIs mean slow pages. Check server timing in DevTools Network tab
INP Improvements
INP measures how fast the page responds to user input. Slow JavaScript is almost always the culprit.- Break up long tasks — split 200ms+ operations into smaller chunks with
setTimeoutorrequestIdleCallback - Debounce expensive handlers — especially
onScroll,onInput,onResize - Move work off the main thread — Web Workers for heavy computation, server for data crunching
- Defer non-critical third-party scripts — chat widgets, analytics, A/B test tools
CLS Improvements
CLS penalizes layout shifts that happen after initial render. Most fixes are structural.- Always set
widthandheighton images, videos, iframes, and embeds - Reserve space for ads and lazy-loaded content — empty
<div style="min-height: 250px">placeholders - Avoid injecting content above the fold after initial render (cookie banners, notification bars)
- Use
font-display: optionalfor custom fonts to prevent FOUT-based layout shift
Hiveku-Specific Tips
Enable Site Enhancements
Go to Publishing > Enhancements and enable the performance bundle — optimized cache headers, preload hints, compression. See Site Enhancements.
Use Next.js Image component
If your site is Next.js, switch
<img> to <Image> for automatic optimization (WebP conversion, responsive srcset, lazy loading).Dynamic import heavy components
Image Optimization Walkthrough
Audit existing images
In DevTools Network tab, filter by image type, sort by size. Anything over 500KB is a candidate.
Convert to WebP or AVIF
Use
sharp, ImageMagick, or an online tool. WebP is universally supported; AVIF is smaller but slightly less compatible.Third-Party Script Audit
Run Lighthouse. Look at the “Third-party usage” section. Anything taking over 500ms of main thread time is a candidate for:- Defer — load after the page is interactive (chat widgets, analytics)
- Replace — swap heavy tools for lighter ones (Plausible instead of Google Analytics if privacy + perf matter more than integrations)
- Remove — if nobody uses it, it shouldn’t be loading
Cache Strategy
Hiveku’s CDN caches static assets by default. For maximum effect:- Versioned assets — set
Cache-Control: max-age=31536000, immutable. Asset URLs change with each deploy, so the browser caches forever with no staleness risk. - HTML — shorter cache (e.g., 60s) or
no-cachewith ETag validation so updates appear fast - API responses — cache carefully. Use
Cache-Control: private, max-age=60for user-specific data, public cache for non-personalized
Verify It Worked
- Run Lighthouse before making changes — note your baseline scores
- Deploy optimizations
- Run Lighthouse again on the same page
- Target 90+ on Performance for mobile
- Confirm LCP < 2.5s, INP < 200ms, CLS < 0.1
Troubleshooting
LCP still slow after optimizations
LCP still slow after optimizations
A render-blocking script is the usual culprit. In DevTools Network, filter by “JS” and look at what’s loading before the hero image — anything with high priority that isn’t essential is blocking paint. Defer it or remove it. Alternatively, server response time is too high — check Time to First Byte in the waterfall.
INP spikes on specific interactions
INP spikes on specific interactions
Profile the interaction in DevTools Performance tab. Record, click the slow element, stop recording. The flame chart shows exactly which function is eating the main thread. Common offenders: large state updates, synchronous DOM queries inside loops, analytics firing on every click.
CLS score rising after a new deploy
CLS score rising after a new deploy
Something you added is inserting content dynamically above the fold. Most common causes: a new chat widget, a cookie consent banner, a notification bar, or a late-loading hero image without fixed dimensions. Compare the “Before” and “After” diagnostic screenshots in Lighthouse.
Lighthouse score is great but CrUX data is bad
Lighthouse score is great but CrUX data is bad
Lighthouse is synthetic (simulated). CrUX is real users with their real networks and devices. Improvements take 28 days to fully reflect in CrUX because it’s a rolling window. If the gap is large, your synthetic test conditions don’t match your real users — try throttling harder (3G, slow CPU) to match actual field conditions.
Images are optimized but Lighthouse still flags them
Images are optimized but Lighthouse still flags them
Lighthouse may be complaining about dimensions (served larger than displayed), not file size. Check the Lighthouse report details — it tells you the exact mismatch. Serve the right size for each breakpoint with
srcset.What’s Next?
SEO Audit
Run a full SEO + performance audit with the AI
Site Enhancements
Enable optimized headers, caching, and compression