Vibeleaderboard
← All Intel
Intel / blog

Dogfooding at scale: migrating cdnjs to Cloudflare's Developer Platform

Source
blog.cloudflare.com
Author
Simona Badoiu
Date

Context

Cloudflare's migration of cdnjs, a service that delivers web software libraries, depended on preserving the exact bytes of existing files. An earlier attempt regenerated assets using newer processing tools, producing different integrity hashes even when the resulting files were otherwise valid. Websites that pinned the old hashes would reject those replacements, according to the migration account.

The team instead copied existing files unchanged into R2 storage. New releases use a workflow that preserves progress and can resume after a failed step. The migration illustrates two separate requirements for shared infrastructure: improving the publishing process while preserving the exact assets that existing websites already trust.

Key takeaways · AI-distilled
  • Splitting storage across Workers KV and a GitHub repo left neither one authoritative. A version could land in KV, silently fail to reach git, and serve fine for weeks. No component knew the full pipeline state, so that alert could not exist.
  • The old ingestion chain used a storage bucket as its message queue: each function dropped a file, and the bucket's new-object event fired the next step. That buys you no dead-letter queue, no backlog visibility, and no clean replay when a step fails.
  • Just polling npm for new versions took 26 Cloud Functions, one per letter of the alphabet, each with its own deployment and its own logs. Answering the question is ingestion healthy meant checking all 26.
  • In the rebuild, R2 holds file content and KV holds only metadata: package info, version lists, SRI hashes. KV is built for heavy reads and rare writes, and R2 has no practical size cap, so source maps and font packs finally fit.
  • Serving now reads cache to R2 to DigitalOcean Spaces, where every published file is mirrored. The disaster-recovery copy doubles as a live fallback, so an R2 outage degrades into a slower read rather than downtime.
Key quotes

“The limits we hit are limits we lifted for everyone.”

“When ChatGPT, Claude, or Cursor scaffold a quick HTML demo, they reach for cdnjs because their training data is full of it.”

“26 functions for 26 letters”

Read the source blog.cloudflare.com
Recommended reads
Comments

Checking sign-in…

Loading comments…