How we cut CDN metadata lookup latency by 91%
Vercel reduced CDN metadata lookup latency by 91% by grouping routing paths into sharded files, cutting cache misses and speeding deployments through optimized data structures and caching strategies.
Vercel’s CDN processes over 80 million routing instructions per second, including metadata lookups to determine valid paths. Previously, each lookup fetched metadata individually, causing recurring cache misses for large, frequently deployed sites with hundreds of thousands of paths. Grouping paths into sharded files allowed a single fetch to populate the cache for many subsequent lookups, reducing latency but introducing new costs that required balancing.
Framework routing rules map incoming requests to target paths, such as resolving /blog/hello-world to /blog/[slug]. Vercel’s Build Output API generates routing metadata from framework-defined infrastructure, which the CDN uses at request time to locate the correct response. Originally, metadata was stored as separate objects per path, leading to cache misses with each new deployment. Sharding metadata into bounded files addressed this by warming multiple paths per fetch while keeping lookups efficient.
The shards use a JSONL layout with sorted paths and metadata as alternating records, paired with an inline index of fixed-width Base64 pointers for direct access. This design allows binary search within shards, parsing only the required metadata while leaving the rest unparsed. The approach leverages existing Vercel infrastructure, including Bloom filters to rule out non-existent paths and techniques from Bulk Redirects for efficient data handling.
Production testing from August 5–12, 2026, showed that shards around 200 KB optimized regional cache hit rates while minimizing transfer costs. Alternative encodings like front-coding paths or custom serialization were evaluated but ultimately balanced size and lookup efficiency. The changes reduced P99 metadata lookup latency by 91% and accelerated deployments by lowering cache miss penalties.