Making Cloudflare Pages the fastest way to serve your sites
Jun 23, 2023Sid Chatterjee, Daniel Walsh, Nevi Shah

Summary
This post details the technical implementation of migrating Cloudflare Pages' asset serving from a large, parsed JSON routing table with regex matching to an O(1) lookup mechanism using Workers for Platforms. The new approach hashes the hostname at runtime to directly identify the correct Worker pipeline, eliminating the latency associated with parsing and iterating through routing tables. The migration strategy involved duplicating deployments, A/B testing, and a phased rollout to ensure minimal customer impact.