Home → Why move your website's files to R2

Why move your website's files from a web server to Cloudflare R2

A traditional web server does everything at once. It stores your files, runs your code, and sends both to every visitor, and you pay for the box and for the bandwidth. That works until a page gets popular, a video goes around, or a download takes off. Then the bandwidth bill, or the server's capacity, becomes the problem.

Object storage such as Cloudflare R2 splits the job. The server keeps running your pages and code, and the heavy files live somewhere built to hand them out. This article covers why people make that move, what R2 does and doesn't do, and how a migration usually goes.

The short version:

Why people move files off a traditional web server

1. Bandwidth costs stop scaling with traffic

On most hosting and cloud storage, you pay every time a file is downloaded. A 200 MB video watched 10,000 times is 2 TB of transfer, and the invoice shows it. R2 charges for the storage you use and for the number of requests, not for the data that leaves. For sites that serve large images, video, 3D models, PDFs or software downloads, this is usually the largest saving available.

2. Your server is no longer the bottleneck

When the web server serves every file, a burst of downloads competes with the pages and code that need the same CPU, memory and network. Move the heavy files elsewhere and the server only does the small jobs. Many sites can then drop to a smaller, cheaper plan, or stop worrying about traffic spikes.

3. Files are served from the edge

A single web server sits in one region, so visitors far away wait longer. Behind a custom domain, R2 objects are cached in Cloudflare's network, so repeat requests are answered near the visitor and never reach the storage at all.

4. Storage that scales without planning

A web server has a disk of a fixed size. When it fills, you resize, migrate or add volumes. Object storage has no such ceiling: you add objects and pay for what you hold. There is also a monthly free allowance, so small sites often pay nothing.

5. Less lock-in

R2 is S3 compatible. The same tools you use for any S3 service (command-line clients, sync tools, libraries in most languages) point at R2 with a different endpoint. If you later want to move to another S3-compatible store, the data and the tooling come with you.

6. Separation helps resilience and security

Keeping public files in a bucket, away from your application server, means a compromised or overloaded app doesn't take your assets down with it, and the bucket's access rules are separate from the server's. Backups and cross-environment sharing also get simpler when files have one home.

What R2 can't do

Be honest about the limits before you plan a migration.

What is worth moving

Good candidates

Usually better left where they are, or moved to Pages or Workers instead: HTML pages that rely on clean URLs or redirects, and anything that executes on the server.

A common result looks like this: the pages stay on the original host (or on Pages), and the heavy files are served from a subdomain such as cdn.example.com, backed by R2.

How a migration usually goes

  1. Inventory your files. Find out what is big, what is popular, and what rarely changes. Check your server logs or hosting dashboard for the biggest bandwidth users.
  2. Create a bucket in the Cloudflare dashboard and an API token with access to it. Transfers use the S3 API, which needs an access key and secret pair as well.
  3. Copy the files. Use the dashboard for small sets, or an S3-compatible tool for large ones: command-line clients such as rclone or the AWS CLI, Cloudflare's wrangler, or a desktop file manager that supports R2. Keep the folder structure unchanged so URLs stay predictable.
  4. Attach a custom domain to the bucket (for example cdn.example.com) so files are served through the CDN. The default r2.dev address is meant for testing and is rate limited, so it isn't suited to production.
  5. Set caching rules. Decide how long browsers and the CDN should keep files. Long lifetimes are fine for files you version by name.
  6. Update your site to point at the new addresses, and keep redirects from the old URLs if they were public.
  7. Test, then monitor. Check the pages, the cache headers and the response times, and watch your costs for a billing cycle before you remove the files from the old server.

Frequently asked questions

Is R2 really free to download from?

Cloudflare doesn't charge egress fees on R2. You still pay for storage, and for requests beyond the free monthly allowance. Check Cloudflare's pricing page for current numbers.

Can I host my entire website on R2?

You can host a static site, but R2 itself doesn't provide index pages, clean URLs, custom 404 pages or redirects. Cloudflare Pages, or a Worker in front of the bucket, fills that gap. Many sites keep their pages where they are and move only the large files.

Will my existing S3 tools work?

Usually yes. R2 is S3 compatible, so tools that accept a custom S3 endpoint can talk to it. Or use a dedicated R2 file manager like R2 Bucket Boss that automatically handles cache purging and other R2 management functions.

What if I replace a file and visitors still see the old one?

That is the CDN cache. Purge the cached URL, or give new versions new file names.

Do I have to change my code?

Mostly the file URLs: point image, video and download links at the new domain.

Is R2 faster than my web server?

For heavy files, usually yes for visitors far from your server, because the CDN answers from nearby. For small pages on a well-placed server, the difference may be small.

When is moving to R2 not worth it?

When your files are small, your traffic is low and your current plan already covers it. Moving pays off when large files and traffic make bandwidth or server load your main cost.

Published November 15, 2026. Cloudflare changes R2 features and pricing from time to time, so check Cloudflare's documentation for current details. ← Back to 10base-t