
9/25/2023 · Matt Bullock, William Woodhead
What this post added
Introduced Cloudflare Fonts, a feature that rewrites HTML on the fly to serve Google Fonts from the customer's own domain. This eliminates third-party requests to Google, enhancing privacy by not sharing user data like IP addresses and user agents. It also significantly improves performance by reducing DNS lookups, socket connections, and TLS negotiations from eight round trips to one, by embedding CSS and transforming font URLs. The feature leverages the ROFL (Response Overseer for FL) module, written in Rust, for efficient HTML alteration during streaming. Fonts are cached within Cloudflare's infrastructure, and Fontsource/NPM are used for loading and caching. This resulted in a significant reduction in First Contentful Paint (FCP) and an improvement in Lighthouse performance scores.