Cloudflare has launched Local Uploads for R2 in open beta, a breakthrough feature that dramatically improves upload performance for globally distributed applications by writing data close to users first, then asynchronously replicating to the bucket's primary location—all while maintaining strong consistency.
The Distance Problem in Cloud Storage
Traditional object storage architectures face a fundamental challenge: data must physically reside somewhere, and users far from that location experience slower upload times due to geographic distance. For applications with global user bases—whether uploading media content, streaming telemetry data, or collecting logs from distributed systems—this latency becomes a critical bottleneck.
R2, Cloudflare's object storage solution built on their global network, already solves the read performance challenge through automatic worldwide caching. Out of the box, R2 delivers fast reads anywhere while maintaining strong consistency and eliminating egress fees. Local Uploads now extends this performance advantage to write operations.
75% Reduction in Upload Request Duration
Cloudflare's benchmarks demonstrate the dramatic impact of Local Uploads. In synthetic tests simulating cross-region upload scenarios—with a client in Western North America uploading to a bucket located in Asia-Pacific—Local Uploads reduced Time to Last Byte (TTLB) from approximately 2 seconds to around 500 milliseconds.
This represents a 75% reduction in total request duration, translating to significantly improved user experience and application responsiveness. During both private beta testing with customers and controlled synthetic workloads, the performance gains were consistent and substantial.
How Local Uploads Works
The architecture behind Local Uploads is elegantly simple yet powerful. When an upload request reaches R2 with Local Uploads enabled, the system evaluates whether the client and bucket are in the same region:
Same Region: The request follows the standard flow, writing directly to the bucket's storage infrastructure.
Different Regions: R2 writes the object data to storage infrastructure close to the client while simultaneously publishing metadata to the bucket's region. The object becomes immediately accessible—there's no waiting period for replication to complete.
This approach provides instant read-after-write consistency. Users can access uploaded objects immediately, even as background replication ensures data durability across regions. The process is completely transparent to applications, requiring no code changes.
The Technical Architecture
R2's infrastructure comprises three core components working in concert:
R2 Gateway Worker: Deployed globally via Cloudflare Workers, this handles authentication and routing for all API requests at the network edge.
Durable Object Metadata Service: Built on Cloudflare's Durable Objects, this distributed layer manages object metadata including keys, checksums, and replication state.
Distributed Storage Infrastructure: The underlying system that persistently stores encrypted object data across Cloudflare's global network.
Without Local Uploads, data streams from the client through the gateway directly to storage in the bucket's region. With Local Uploads enabled for cross-region requests, data is written locally first, dramatically reducing the distance that streaming bytes must travel during the upload process.
Intelligent Replication Strategy
Local Uploads implements a sophisticated asynchronous replication system built on Cloudflare Queues. When an object is uploaded to a local storage location, R2 atomically performs three operations:
- Stores the object metadata
- Creates a pending replica key tracking required replications
- Creates a replication task marker keyed by timestamp
A background polling service periodically scans replication task markers and dispatches them to regional queues. Consumer services then pull tasks, batch them efficiently based on data volume, and execute the replication through Gateway Workers. This pull model allows dynamic adjustment based on system health while guaranteeing at-least-once delivery.
Persistence Through R2 Bucket Mounting
Containers and edge compute environments are typically ephemeral, but Local Uploads leverages R2's bucket mounting capabilities to provide persistent storage that survives container lifecycles. By mounting R2 buckets as filesystem partitions, session memory files, conversations, and other critical assets persist beyond individual compute instances.
This architectural decision ensures that even in dynamic, distributed environments, application state remains durable and accessible across the global network.
When to Enable Local Uploads
Local Uploads delivers maximum value for specific workload patterns:
- Globally Distributed Users: Applications serving users across multiple continents who upload content regularly
- Performance-Critical Uploads: Systems where upload speed and reliability directly impact user experience
- Location-Flexible Architecture: Applications that benefit from optimized write performance without changing their bucket's primary location
Cloudflare's R2 dashboard provides Request Distribution by Region metrics, helping developers understand their geographic traffic patterns and make informed decisions about enabling Local Uploads.
Zero Additional Cost
Local Uploads is available in open beta with no additional charges beyond standard Class A operation costs—the same pricing as regular uploads without the feature. Enabling Local Uploads is seamless with no traffic interruption, and can be activated through either the Cloudflare Dashboard or a single Wrangler CLI command:
npx wrangler r2 bucket local-uploads enable [BUCKET]
The Broader Implications
Local Uploads represents more than just a performance optimization—it demonstrates how edge computing principles can fundamentally reimagine cloud storage architecture. By intelligently distributing write operations while maintaining strong consistency guarantees, Cloudflare proves that developers don't have to choose between global performance and data integrity.
As applications become increasingly global and users expect instant responsiveness regardless of location, technologies like Local Uploads become essential infrastructure. The ability to write data locally, access it immediately, and trust that it will replicate reliably across regions without application-level complexity is precisely the kind of abstraction that accelerates innovation.
Getting Started
Developers can enable Local Uploads today on any existing R2 bucket without code changes or service interruption. The feature is available in open beta, with comprehensive documentation and community support through Cloudflare's Developer Discord.
For applications struggling with cross-region upload performance, or teams planning globally distributed systems, Local Uploads offers a straightforward path to dramatically improved user experience—backed by Cloudflare's global network and commitment to zero egress fees.
Source: Cloudflare Blog - R2 Local Uploads announcement. Learn more at the Cloudflare R2 documentation.