| name | vercel-performance-tuning |
| description | Optimize Vercel deployment performance with caching, bundle optimization, and cold start reduction.
Use when experiencing slow page loads, optimizing Core Web Vitals,
or reducing serverless function cold start times.
Trigger with phrases like "vercel performance", "optimize vercel",
"vercel latency", "vercel caching", "vercel slow", "vercel cold start".
|
| allowed-tools | Read, Write, Edit, Bash(vercel:*), Bash(npx:*) |
| version | 1.18.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","vercel","performance","caching","optimization"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Vercel Performance Tuning
Overview
Optimize Vercel deployment performance across four levers: edge caching, bundle size reduction, serverless function cold start elimination, and Core Web Vitals improvement. Uses real Vercel cache headers, ISR, and Edge Functions for maximum performance.
Prerequisites
- Vercel project deployed with accessible URL
- Access to Vercel Analytics (dashboard)
- Bundle analyzer available (
@next/bundle-analyzer or similar)
Instructions
Step 1: Establish Performance Baseline
vercel inspect https://my-app.vercel.app
npx lighthouse https://my-app.vercel.app --output=json --quiet \
| jq '{performance: .categories.performance.score, lcp: .audits["largest-contentful-paint"].numericValue, cls: .audits["cumulative-layout-shift"].numericValue}'
ANALYZE=true npx next build
Enable Vercel Analytics in the dashboard under Analytics tab for ongoing monitoring.
Step 2: Configure Edge Caching
import type { VercelRequest, VercelResponse } from '@vercel/node';
export default function handler(req: VercelRequest, res: VercelResponse) {
res.setHeader('Cache-Control', 's-maxage=60, stale-while-revalidate=300');
res.json({ data: (), : ().() });
}