# Cutting a Next.js Site's Origin Transfer by 90%

> How this portfolio went from blowing its Vercel bandwidth quota to serving 495 fully static pages from the CDN.

URL: https://www.matthewswong.com/en/case-studies/vercel-origin-transfer/

- DevOps / Performance

- **−95%** i18n payload
- **495** static pages
- **−73%** image weight
- **>90%** origin transfer reduction

## Problem

This portfolio blew through its Vercel Fast Origin Transfer quota — 15.13 GB used against a 10 GB limit. Every page was dynamically SSR'd because next-intl's getMessages() without setRequestLocale forced dynamic rendering, and each response embedded a 1.6 MB i18n payload: the full text of 218 blog posts shipped to the client provider on every single page.

## Approach

1. Profiled origin transfer usage by path to find which routes were actually burning the quota.
2. Added setRequestLocale so next-intl no longer forced dynamic rendering, enabling static rendering across the site.
3. Stripped blog content from the client messages (1,589 KB → 76 KB, −95%), re-injecting only the current post's content on each blog page.
4. Added generateStaticParams for all 436 blog paths so every post is prerendered at build time.
5. Recompressed 67 images (54.7 MB → 14.8 MB), added immutable cache headers, and re-enabled ETags.

## Outcome

495 pages are now prerendered and served from the CDN, origin transfer was cut by more than 90%, and LCP is no longer gated on a megabyte of JSON.

## Stack

Next.js App Router, next-intl, Vercel, sharp

---

- HTML version: https://www.matthewswong.com/en/case-studies/vercel-origin-transfer/
- Bahasa Indonesia: https://www.matthewswong.com/id/case-studies/vercel-origin-transfer/
- Site index for agents: https://www.matthewswong.com/llms.txt
- Sitemap: https://www.matthewswong.com/sitemap.xml
- API description (OpenAPI): https://www.matthewswong.com/openapi.json
