TLDR Dev · ARTICLES & TUTORIALS

SCALING REDIRECTS TO INFINITY ON VERCEL

vercel.com8 min read

Summary from the TLDR Dev newsletter

Vercel had latency and cost challenges scaling web redirects to millions using existing routing rules and middleware. Their initial solution involved sharding redirect data into JSONL files and using Bloom filters for fast "no redirect" checks, but parsing entire JSON shards for positive matches still caused performance bottlenecks. To overcome this, they implemented a binary search over sorted redirect keys within each shard, allowing them to retrieve individual redirect data without parsing the entire shard.