Friday, June 5, 2026

Cloudflare R2 for Digital Product Storage and Delivery: No Stripe, No PayPal, Just Speed and Scale

Cloudflare R2 for Digital Product Storage and Delivery: No Stripe, No PayPal, Just Speed and Scale

Introduction

Most guides tell you to use Gumroad, Shopify, or Payhip when you sell digital products in Africa. They all hinge on Stripe or PayPal. If youre based in Lagos or Nairobi, Stripe blocks you for KYC reasons, PayPal doesnt support payouts, and the fees eat 8% on every sale. We refused to wait six months for a Stripe account or lose 8% to payment rails we cant control.

Instead, we moved money with stablecoins on Flutterwave and automated delivery with Cloudflare R2 and Workers. The cost is pennies per gigabyte, download speeds are global, and theres no platform telling us when our funds are ready. This stack works in Accra, Nairobi, or Kinshasa because it only needs an internet connection and a local bank account.

Step 1: Store everything on Cloudflare R2

We upload ebooks, video files, fonts, and templates directly to an R2 bucket. One bucket holds all product variants—no per-file pricing, no vendor lock-in. Files sit behind a public DNS name we control (files.example.com) with CORS enabled so browsers can fetch without cors-anywhere hacks.

Bandwidth is cheap: $0.015 per GB for the first terabyte. Thats cheaper than AWS S3 in us-east-1 after egress fees. For a 100 MB course, delivery costs less than one naira. No surprise bills, no minimum spend, no region restrictions.

We use R2s object lock feature to prevent accidental overwrites. Tags on each object track file type, version, and license tier. A Worker script checks tags before serving, so a customer who buys the basic plan never sees the pro template.

Step 2: Automate delivery with Workers

R2 pairs with Cloudflare Workers to generate signed URLs valid for 24 hours. The Worker runs a single JavaScript file:

const bucket = new R2Bucket(); addEventListener(fetch, (event) => { const url = new URL(event.request.url); const key = url.pathname.slice(1); const signedUrl = await bucket.getSignedUrl(key, { expiry: 86400 }); return Response.redirect(signedUrl, 302); });

No CDN rewrites, no nginx configs, no Node.js server we babysit. Workers spins up in 30 ms worldwide, so a user in Kigali and one in Berlin get the same latency.

We cache signed URLs in KV to avoid regenerating for repeat buyers. KV costs $5 per month for a million reads, which is cheaper than Redis on AWS ElastiCache. Failures drop to near zero because Workers handles regional edge traffic automatically.

Step 3: Accept crypto without a middleman

We accept USDC on Polygon at checkout. The customer pays from any wallet—MetaMask, Trust, or even a USSD crypto gateway like Bitmama. A Cloudflare Worker endpoint receives the on-chain receipt via webhook, verifies it on-chain in under 500 ms, then triggers the signed URL generation.

No Stripe webhook, no node running 24/7 in a data center. The worker verifies the transaction hash against Polygonscan within the same request. If the transaction is real, it emails the buyer the signed URL and marks the license active in KV.

We hold no customer funds. USDC arrives and leaves the hot wallet in seconds. Withdrawals go to Flutterwave via stablecoin-to-local-currency rails, clearing in minutes on most days.

Step 4: Integrate local payouts with Flutterwave

Every day at 6 p.m. WAT, a cron-triggered Worker scans KV for new sales. It sums earnings, converts to NGN using Flutterwaves rate, and sends a payout batch. Flutterwaves API returns a unique reference per withdrawal; Workers records it in KV so we never pay twice.

Banking friction in Nigeria means some payouts still bounce for name mismatches. We added a step to verify the beneficiary account name with Flutterwaves identity lookup before queuing the withdrawal. Bounces dropped from 12% to under 1% because we validate locally.

Fees are 1.4% on payouts—cheaper than PayPals 5% cross-border rate. Funds land in our GTBank or Kuda account same day if sent before 3 p.m. WAT.

Step 5: Security and scale without friction

R2 buckets are private by default. We use Workers to generate short-lived, signed URLs so even if an attacker brute-forces an object key, the URL expires before they finish downloading.

CORS headers restrict uploads to our checkout domain only. Uploads happen over HTTPS POST from our Next.js storefront running on Vercel Edge Functions. File sizes are capped at 500 MB in the Worker, but large courses split into 100 MB chunks automatically.

We monitor Workers logs from Cloudflare dashboard; alerts fire to a Slack channel if latencies spike above 200 ms. No uptime tickets, no server restarts—just a

TightBucket on one page — where a site loses sales

Conversion leak auditing · Coldcode SI Labs TightBucket TightBucket finds the leaks costi...