Planet-Scale Serverless: cdnjs Powers 9 Billion Daily Requests on Cloudflare

cdnjs moved 9B daily requests to Cloudflare’s serverless platform, achieving 98.6% cache hit and overcoming limits.
Glowing interconnected network nodes spanning Workers, D1, KV, and R2 with data flows, blue and orange puzzle pieces converging into a core, representing cdnjs's serverless infrastructure.
Visualizing planet-scale serverless connectivity powering billions of requests daily. By Andres SEO Expert.

Key Takeaways

  • cdnjs migrated from a fragmented GCP, VM, and GitHub pipeline to Cloudflare’s unified Developer Platform (Workers, Workflows, D1, R2, KV, Containers).
  • The migration uncovered and forced Cloudflare to raise hard platform limits: subrequest cap from 1,000 to 10 million, Workflows steps from 1,024 to 10,000.
  • Now handling 9 billion daily requests and a 98.6% cache hit rate, cdnjs validates that composable serverless primitives can operate at planetary scale.

Nine Billion Daily Requests Shift to a Unified Developer Platform Stack

On June 23, 2026, cdnjs — the open-source content delivery network serving roughly 12% of all websites — began running exclusively on Cloudflare’s Developer Platform. The migration closed a chapter in which the publishing pipeline relied on a fragmented mix of Google Cloud Platform services, a bare-metal virtual machine, and a sprawling GitHub repository that had grown past 1.1 terabytes of packed storage. Cloudflare reports that the new architecture collapsed every part of the pipeline onto a single platform built from Workers, Workflows, D1, Queues, Workers Cache, R2, KV, and Containers, while maintaining the library’s signature zero-cost, zero-rate-limit access model.

The move cements cdnjs as a high-stakes, real-world validation of serverless primitives at genuine internet scale. With an average of 108,000 requests per second, 9 billion daily requests, and a 98.6% cache hit rate across more than 330 data centers, the CDN’s traffic profile demands that every architectural component hold up to extremes that synthetic benchmarks rarely replicate.

What Pain Points Forced the Rebuild

The previous serving layer already performed admirably. A 2020 shift to Cloudflare Workers and KV for delivery had given every asset pre-compressed Brotli and gzip variants, lowering transfer sizes and accelerating cold-load performance for end users. But the publishing pipeline — the continuous machinery that watches npm and GitHub for new library releases, downloads tarballs, processes them, and writes the outputs — remained anchored on GCP.

Cloudflare’s blog post details five interlocking friction points that made the pipeline increasingly brittle. The deepest wound was observability. A single package update ricocheted through Cloud Functions, Google Cloud Storage object events, Pub/Sub topics, a git-sync VM, and KV, with no correlation ID stitching the traces together. A version could process cleanly into KV, quietly fail to land in the GitHub mirror, and surface only when a human spotted store divergence weeks later.

Storage itself suffered from split-brain ambiguity. Files lived simultaneously in edge-based KV and in the GitHub repository, with neither copy acting as the authoritative source of truth. The ingestion pipeline wrote to both at the end of every run, making reconciliation nearly impossible when drift occurred.

The pipeline’s choreography relied on object storage events doubling as a message queue. A Cloud Function dropped a file into a bucket; the bucket’s event notification triggered the next function. Without a dead-letter queue or backlog visibility, a transient failure left no clean path to replay a step.

Sharding played its own strange role. Just checking npm for new library versions demanded 26 separate Cloud Functions, one for each letter of the alphabet, each with its own deployment and logs. The cdnjs/cdnjs GitHub repository, meantime, swelled past 1.1 TB, a size at which GitHub’s archive service refused to generate downloadable tarballs or zip files, and cloning became a patience-taxing exercise. Cloudflare acknowledges that retiring this GCP surface area also closed every recently opened cdnjs vulnerability, a quieter security dividend that came bundled with the migration.

How Platform Limits Were Discovered and Then Lifted

Designing the target architecture proved only half the challenge. Moving the existing catalog without breaking a single file already pinned in the wild required a careful migration strategy. An earlier attempt had been rolled back because re-processing packages with non-deterministic minifiers and compressors produced outputs with different SRI hashes — a serving break for the many sites that pin those integrity hashes in their HTML.

So Cloudflare’s team chose to copy the existing content from KV to R2 byte-for-byte, then delete it from KV once verified. That decision transformed the problem from re-processing millions of files to copying millions of files across accounts without dropping any. Over the course of the migration, two hard platform limits surfaced.

The Workers subrequest cap, fixed at 1,000 per invocation on paid plans, became a bottleneck for any package containing thousands of files. Even fanning out work across parallel Workers hit the same ceiling. Later, Workflows hit their own ceiling at 1,024 steps per instance. Instead of merely working around these limits, the team engaged the Workers and Workflows product groups. The outcome directly reshaped the platform: paid-plan subrequests now climb to 10 million per invocation, and Workflows default to 10,000 steps, configurable to 25,000.

The new ingestion pipeline itself leverages Cloudflare Workflows for durable execution. A cron job triggers a PackageUpdatesWorkflow every ten minutes, which spawns child workflows for downloading, processing, and publishing each discovered version. CPU-intensive compression is offloaded to Cloudflare Containers via a pattern where each ProcessingWorkflow writes an uncompressed file to R2, enqueues a job, and hibernates until an R2 event notification signals completion. A Durable Object counter coordinates the parallel processing of thousands of file children per package, waking the parent only when every child has finished.

R2 now serves as the single source of truth for file content, erasing the split-brain problem. KV retains only metadata — package info, version lists, and SRI hashes — matching its design for high read volume with infrequent writes. Workers Cache, a tiered cache introduced earlier this year, sits in front of the serving Worker, eliminating a previously external caching layer. DigitalOcean, a long-time sponsor, mirrors every file to Spaces, giving the architecture a live disaster-recovery fallback that the serving worker reads through whenever R2 cannot return a file.

What the Migration Signals for the Broader Performance Landscape

Beyond the specific mechanics of cdnjs, the migration functions as a public, real-world stress test of composable serverless primitives. When an infrastructure stack can sustain 9 billion requests daily, ingest the full npm and GitHub release firehose, and run CPU-heavy compression on every text-based asset, it validates a model where developers can build long-running, multi-step pipelines without provisioning a single virtual machine.

The limits that cracked during the migration reinforce a rarely discussed truth: platform defaults are often the silent bottleneck in performance-critical systems. Raising the subrequest ceiling from 1,000 to 10 million isn’t a minor tuning knob; it alters the design space for anyone building data-intensive workflows on Workers, from real-time log processors to e-commerce catalog sync engines. The Workflows step limit increase similarly unlocks the ability to orchestrate longer chains directly, reducing the complexity of sharding or chaining multiple workflow instances.

The appeal of cdnjs to large language models offers an additional, often overlooked performance multiplier. ChatGPT, Claude, and Cursor frequently embed cdnjs script tags into generated HTML because the CDN’s consistent URL patterns and versioned, immutable assets reduce hallucination risk. The heavy training-data imprint means that millions of AI-assisted deployments default to loading libraries from cdnjs, funneling enormous sustained traffic through a delivery system that must remain reliable and cache-optimized regardless of the request source. As AI-generated code becomes a larger fraction of total page loads, the performance characteristics of open CDNs that models prefer become a material factor in aggregate web latency.

Cloudflare’s team notes that the architecture does not rule out future support for browser-native ES modules, transformed at publish time using the same Workflows-plus-Containers pattern. While no commitment has been made, the possibility shifts the performance conversation from simple asset delivery toward a model where the CDN itself can perform build-step transformations, potentially eliminating the need for a bundler in lightweight projects and reducing client-side JavaScript payloads.

Where a Free CDN at Planetary Scale Points Next

The cdnjs migration is, at its core, a quiet demonstration that infrastructure maintained as a public good can be engineered to the same resilience bar as the most demanding private deployments. The same composable building blocks that now publish and serve a library catalog touching nearly half the JavaScript CDN market are available to any developer on Cloudflare’s platform, with the raised limits benefiting every user equally. When a free, no-signup CDN can absorb the full weight of AI-driven traffic, survive split-brain failures by redesigning around a single source of truth, and still deliver nine billion requests a day with a near-perfect cache hit rate, it sets a practical ceiling for what performance engineering can achieve with serverless architecture.

Organizations evaluating their own delivery pipelines — whether migrating legacy infrastructure, accelerating time-to-first-byte, or hardening against traffic anomalies — can draw immediate, concrete lessons from the patterns exposed here. For teams that need to wring every millisecond out of their stack, expertise in site speed and technical optimization turns these architectural insights into measurable wins. When the underlying hosting environment itself becomes a bottleneck, managed cloud infrastructure tuned for high-throughput workloads can provide the reliability that a multi-billion-request asset library demands. To explore how these strategies apply to your own performance goals, connect with Andres and learn more about Andres SEO Expert.

Frequently Asked Questions

Why did cdnjs migrate away from Google Cloud Platform?

The migration was driven by five interlocking pain points: poor observability across a fragmented pipeline (Cloud Functions, Pub/Sub, git-sync VM, KV) with no correlation IDs; split-brain storage where files lived in both KV and GitHub without a single source of truth; reliance on object storage events as a fragile message queue lacking dead-letter handling; a sharded npm-checking scheme requiring 26 separate Cloud Functions; and a 1.1 TB GitHub repository that prevented cloning and archiving. The migration also closed recently opened security vulnerabilities tied to the old GCP surface area.

How did Cloudflare migrate existing content without breaking SRI hashes?

The team chose to copy files byte-for-byte from KV to R2, then delete them from KV only after verification. This avoided re-processing files with non-deterministic minifiers or compressors, which would have changed Subresource Integrity (SRI) hashes and broken websites that pin those hashes in their HTML.

What platform limits were encountered during the migration and how were they addressed?

Two hard limits surfaced: the Workers subrequest cap of 1,000 per invocation (even on paid plans) bottlenecked packages with thousands of files, and Workflows had a 1,024-step cap per instance. Instead of working around them, the team engaged Cloudflare’s product groups to raise the limits: paid-plan subrequests now support up to 10 million per invocation, and Workflows default to 10,000 steps (configurable to 25,000).

What does the new cdnjs architecture look like on Cloudflare?

The pipeline uses Cloudflare Workflows for durable execution (triggered by a cron job every 10 minutes), Durable Objects to coordinate parallel file processing, R2 as the single source of truth for file content, KV for metadata (package info, version lists, SRI hashes), Workers Cache for a tiered cache in front of the serving Worker, and Cloudflare Containers for CPU-intensive compression. A DigitalOcean Spaces mirror provides live disaster recovery.

How does the cdnjs migration validate serverless primitives at internet scale?

The architecture sustains an average of 108,000 requests per second, 9 billion daily requests, and a 98.6% cache hit rate across 330+ data centers. It ingests the full npm and GitHub release firehose and runs CPU-heavy compression on every text asset without provisioning any VMs. This demonstrates that composable serverless building blocks can handle workloads synthetic benchmarks rarely replicate.

What future capabilities does the new architecture enable for cdnjs?

The Workflows-plus-Containers pattern could support publishing browser-native ES modules, transforming them at publish time. This would allow the CDN to perform build-step transformations, potentially eliminating the need for a bundler in lightweight projects and reducing client-side JavaScript payloads. Cloudflare has not committed to this feature yet but notes it is architecturally possible.

Prev Next

Subscribe to My Newsletter

Subscribe to my email newsletter to get the latest posts delivered right to your email. Pure inspiration, zero spam.
You agree to the Terms of Use and Privacy Policy