- Open Chrome DevTools (F12)
- Go to Lighthouse tab
- Select: Performance, Accessibility, Best Practices, SEO
- Generate Report for both Mobile and Desktop
- Target: Score > 90 in all categories
// Bad - unoptimized, no lazy loading
<img src="/large-image.jpg" />
// Good - Next.js Image component
import Image from 'next/image'
<Image src="/large-image.jpg" width={800} height={600} alt="Description" />Next.js Image automatically: resizes, lazy-loads, serves WebP format.
Use dynamic imports for heavy components that aren't needed on initial load:
import dynamic from 'next/dynamic'
const HeavyChart = dynamic(() => import('./HeavyChart'), {
loading: () => <p>Loading chart...</p>,
})Always show feedback during data fetching:
// Use shadcn Skeleton component
import { Skeleton } from "@/components/ui/skeleton"
if (isLoading) return <Skeleton className="h-12 w-full" />Cache slow database queries with unstable_cache:
import { unstable_cache } from 'next/cache'
export const getStats = unstable_cache(
async () => {
const { data } = await supabase.from('stats').select('*')
return data
},
['dashboard-stats'],
{ revalidate: 3600 } // Refresh every hour
)- All images use
next/imagecomponent - Heavy components use dynamic imports
- Loading states show skeleton/spinner
- Fonts loaded with
next/font - No unnecessary client-side JavaScript (
"use client"only when needed)
- Vercel Analytics - Automatic on Pro plan, shows Core Web Vitals
- Vercel Speed Insights - Real user performance data