Vercel Speed Audit Skill
Optimize Vercel build and deploy speed for any project. Run as a checklist when starting new projects or auditing existing ones.
When to Use
- - New project setup — configure optimal defaults from day one
- Build times creeping up — audit and fix performance regressions
- Deploy queue bottlenecks — eliminate waiting on concurrent builds
- Production incidents — use instant rollback instead of waiting for a new build
- Cost optimization — balance speed vs spend on build infrastructure
Triage First (Don't Blindly Run All 10)
Before running the full checklist, measure and assess:
CODEBLOCK0
Decision tree:
| Build Time | Action |
|---|
| < 20s | Only do items 0, 1, 3-5, 10. Skip GitHub Actions (#8), skip barrel file audit (#6) unless codebase is large. |
| 20-60s |
Do items 0-7, 10. GitHub Actions (#8) is optional. |
|
60s+ | Do everything. GitHub Actions (#8) becomes high-value. |
Auth-gated app? (All pages behind login)
→ Skip ISR (#9) entirely. ISR caches one response for all users — incompatible with per-user content.
Framework:
→ SvelteKit: Also read docs/sveltekit.md — includes adapter-vercel switch, prerendering, $env tips.
→ Next.js/Nuxt/Other: docs/general.md covers framework-agnostic items.
Checklist (Ordered by Impact)
| # | Optimization | Impact | CLI-checkable? | Plan Required |
|---|
| 0 | Use explicit adapter (e.g., adapter-vercel not adapter-auto) | Faster, no detection overhead | ✅ Check config | Any |
| 1 |
Turbo Build Machines | 50-70% faster builds | ❌ Dashboard only | Pro+ |
|
2 |
On-Demand Concurrent Builds | Eliminates deploy queue | ❌ Dashboard only | Pro+ |
|
3 |
Prerender Static Pages | Fewer functions, faster TTFB | ✅ Audit code | Any |
|
4 |
Ignored Build Step | Skip irrelevant builds | ✅ Check vercel.json | Any |
|
5 |
Prioritize Production Builds | Prod deploys go first | ❌ Dashboard only | Pro+ |
|
6 |
Eliminate Barrel Files | 10-30% build speedup | ✅ Audit code | Any |
|
7 |
Audit & Trim Dependencies | Faster install + bundle | ✅ Run depcheck | Any |
|
8 |
GitHub Actions + --prebuilt | Full cache control, skip Vercel build | ✅ Add workflow | Any |
|
9 |
ISR for Dynamic Pages | Fewer cold starts | ✅ Audit routes | Any |
|
10 |
Instant Rollback | Zero-downtime recovery | ✅
vercel rollback | Hobby: last only; Pro+: any |
Pro plan items (#1, #2, #5): If not on Pro, check team plan first. These are the highest-impact free wins on Pro.
Dashboard Links (Can't Check via CLI)
For a team called <team-slug>:
- - Turbo machines:
https://vercel.com/<team-slug>/<project>/settings → General → Build Machine - Concurrent builds:
https://vercel.com/teams/<team-slug>/settings → Build Queue - Prioritize prod:
https://vercel.com/<team-slug>/<project>/settings → Git → Production prioritization
Docs
Lessons Learned
Real-world findings from running all 10 checks on a SvelteKit project with 16-18s builds:
- 1. Half the checklist was overkill — builds were already fast. Triage step now prevents wasted effort.
- ISR is irrelevant for auth-gated apps — every page served per-user content. Added decision tree.
adapter-auto → adapter-vercel was a missed win — not in original 10 but came up in dep audit. Now item #0.- Dashboard-only settings are the highest-impact items (Turbo, concurrent, priority) but can't be verified via CLI. Added direct links.
- GitHub Actions + prebuilt only worth it at 60s+ — for fast builds, the Vercel Git integration is simpler and equally fast.
- The dep audit found the project was already lean (11 deps, 84MB node_modules, 472K client bundle). Only one unused dep (clsx).
- Team/plan tier gates most high-impact items — checking plan should be step 1.
Quick Start
- 1. Triage: Measure build times + check plan tier
- Run applicable items from the checklist based on decision tree
- If SvelteKit, also review INLINECODE13
- Track findings in a report file (e.g.,
vercel-speed-report.md) - For complex CI needs, follow INLINECODE15
Vercel 速度审计技能
优化任何项目的 Vercel 构建和部署速度。在启动新项目或审计现有项目时,作为检查清单运行。
使用时机
- - 新项目搭建 — 从第一天起配置最佳默认设置
- 构建时间逐渐增长 — 审计并修复性能退化
- 部署队列瓶颈 — 消除并发构建的等待时间
- 生产事故 — 使用即时回滚,无需等待新构建
- 成本优化 — 在构建基础设施的速度与支出之间取得平衡
先进行分诊(不要盲目运行全部 10 项)
在运行完整检查清单之前,先测量和评估:
bash
1. 检查当前构建时间
cd <项目> && npx vercel ls --limit 5
2. 检查团队/计划层级
npx vercel team ls
决策树:
| 构建时间 | 操作 |
|---|
| < 20秒 | 仅执行第 0、1、3-5、10 项。跳过 GitHub Actions(#8),除非代码库庞大,否则跳过桶文件审计(#6)。 |
| 20-60秒 |
执行第 0-7、10 项。GitHub Actions(#8)为可选。 |
|
60秒以上 | 执行所有项目。GitHub Actions(#8)成为高价值项。 |
需要认证的应用?(所有页面都在登录后)
→ 完全跳过 ISR(#9)。ISR 为所有用户缓存一个响应——与按用户内容不兼容。
框架:
→ SvelteKit:同时阅读 docs/sveltekit.md — 包含 adapter-vercel 切换、预渲染、$env 提示。
→ Next.js/Nuxt/其他:docs/general.md 涵盖框架无关的项目。
检查清单(按影响程度排序)
| # | 优化项 | 影响 | 可通过 CLI 检查? | 所需计划 |
|---|
| 0 | 使用显式适配器(例如,使用 adapter-vercel 而非 adapter-auto) | 更快,无检测开销 | ✅ 检查配置 | 任意 |
| 1 |
Turbo 构建机器 | 构建速度提升 50-70% | ❌ 仅限仪表盘 | Pro+ |
|
2 |
按需并发构建 | 消除部署队列 | ❌ 仅限仪表盘 | Pro+ |
|
3 |
预渲染静态页面 | 减少函数数量,加快首字节时间 | ✅ 审计代码 | 任意 |
|
4 |
忽略的构建步骤 | 跳过无关构建 | ✅ 检查 vercel.json | 任意 |
|
5 |
优先处理生产构建 | 生产部署优先进行 | ❌ 仅限仪表盘 | Pro+ |
|
6 |
消除桶文件 | 构建速度提升 10-30% | ✅ 审计代码 | 任意 |
|
7 |
审计并精简依赖项 | 更快的安装 + 打包 | ✅ 运行 depcheck | 任意 |
|
8 |
GitHub Actions + --prebuilt | 完全缓存控制,跳过 Vercel 构建 | ✅ 添加工作流 | 任意 |
|
9 |
动态页面的 ISR | 减少冷启动 | ✅ 审计路由 | 任意 |
|
10 |
即时回滚 | 零停机恢复 | ✅ vercel rollback | Hobby:仅上次;Pro+:任意 |
Pro 计划项目(#1、#2、#5): 如果不在 Pro 计划上,请先检查团队计划。这些是 Pro 计划上影响最大的免费收益。
仪表盘链接(无法通过 CLI 检查)
对于名为 <团队标识> 的团队:
- - Turbo 机器: https://vercel.com/<团队标识>/<项目>/settings → 通用 → 构建机器
- 并发构建: https://vercel.com/teams/<团队标识>/settings → 构建队列
- 优先生产构建: https://vercel.com/<团队标识>/<项目>/settings → Git → 生产优先级
文档
经验教训
在一个构建时间为 16-18 秒的 SvelteKit 项目上运行全部 10 项检查的实际发现:
- 1. 一半的检查清单是多余的 — 构建已经很快。现在分诊步骤可以防止浪费精力。
- ISR 对需要认证的应用无关 — 每个页面都提供按用户内容。已添加决策树。
- adapter-auto → adapter-vercel 是一个被忽视的收益 — 不在最初的 10 项中,但在依赖审计中出现。现在是第 0 项。
- 仅限仪表盘的设置是影响最大的项目(Turbo、并发、优先级),但无法通过 CLI 验证。已添加直接链接。
- GitHub Actions + prebuilt 仅在 60 秒以上时值得使用 — 对于快速构建,Vercel Git 集成更简单且同样快速。
- 依赖审计发现项目已经很精简(11 个依赖项,84MB node_modules,472K 客户端包)。只有一个未使用的依赖项(clsx)。
- 团队/计划层级限制了大多数高影响项目 — 检查计划应该是第一步。
快速开始
- 1. 分诊: 测量构建时间 + 检查计划层级
- 根据决策树从检查清单中运行适用的项目
- 如果是 SvelteKit,同时查看 docs/sveltekit.md
- 在报告文件中跟踪发现(例如,vercel-speed-report.md)
- 对于复杂的 CI 需求,请遵循 docs/github-actions-prebuilt.md