Headless UI for desktop and mobile
One logic layer powering both web views, with thin presentation layers on top.
04 — Case study
Public productLCP tuning on the homepage hero, listing stability, and structured metadata on vehicle detail pages.
Role
Frontend Lead
Context
Caroline.id, automotive marketplace
Period
March 2022 – present
Stack
Next.js, Core Web Vitals, Lighthouse
01 — Problem
Homepage hero and vehicle detail pages dominated LCP, while listings needed stable titles and rich results without duplicate mobile and desktop SEO logic.
Hero imagery on the v2 homepage had to match preload width and quality between server render and client image loaders. Unit detail existed on desktop and mobile routes with middleware choosing layout; both still needed the same canonical URL, Open Graph image, and product structured data.
02 — Approach
Hero banner constants separate mobile and desktop request widths; a helper builds the same URL the LCP image uses so preload and rendered priority stay in sync. Gallery tests assert the first detail image is marked priority for LCP.
Vehicle detail metadata loads car data once, builds title and description from live inventory, sets canonical to the public listing URL, and supplies OG images from CDN paths with a safe fallback image.
Package scripts run Lighthouse on mobile with several throttling presets and write JSON/HTML under a vitals folder so comparisons stay reproducible before chasing one-off field scores.
export async function generateUnitDetailMetadata({
params,
}: {
params: Promise<{ slug: string }>;
}): Promise<Metadata> {
const { slug } = await params;
const car = await fetchCarDetail(slug);
const title = buildSeoTitle(car);
const canonical = buildCanonicalUrl(slug);
return {
title,
description: buildDescription(title),
alternates: { canonical },
openGraph: { images: [pickHeroImage(car)] },
};
}03 — Where AI helped
AI helped sketch JSON-LD fields and lighthouse command flags; I verified schema fields against what the API actually returns and kept canonical rules aligned with middleware rewrites.
04 — Result
LCP work focused on the hero and first gallery image; SEO work centralized metadata and Product JSON-LD on listing routes. Before-and-after LCP and CLS figures will be published once you provide cleared measurements.
Next project
One logic layer powering both web views, with thin presentation layers on top.