All images and videos generated by API易 (Veo 3.1, Sora, Nano Banana, etc.) are hosted on Cloudflare R2’s global CDN, which is fast worldwide by design. If downloads on your server are slow, it is almost always a network-path issue between your server and Cloudflare’s edge, not a CDN problem itself — especially for servers in mainland China accessing overseas CDNs, where cross-border bandwidth, ISP routing, and local DNS resolution often degrade performance.
Key pointCloudflare R2 resource URLs typically look like *.r2.cloudflarestorage.com or a custom domain proxied through Cloudflare. Download speed depends on how efficiently your server can reach the nearest Cloudflare edge node.
For batches of files use a parallel downloader (aria2c -x 8, Python asyncio + httpx) to saturate bandwidth.
Resumable downloads
For large videos, use HTTP Range requests with retry so a failure doesn’t restart from zero.
Connection reuse
Use clients with HTTP/2 or keep-alive (httpx, requests.Session()) to avoid repeated handshakes.
Stream to disk
Stream the response directly to disk instead of loading the whole file into memory.
Python example (recommended):
import httpximport asyncioasync def download(url: str, path: str): async with httpx.AsyncClient(http2=True, timeout=120) as client: async with client.stream("GET", url) as resp: resp.raise_for_status() with open(path, "wb") as f: async for chunk in resp.aiter_bytes(chunk_size=1024 * 256): f.write(chunk)asyncio.run(download("<CDN URL>", "output.mp4"))
If your use case allows it, prefer regions with good connectivity to Cloudflare:
Overseas (recommended)
AWS / GCP / Azure / Cloudflare Workers all reach Cloudflare R2 with very low latency (typically 10-50ms).
China: premium DCs
If you must deploy in mainland China, pick DCs with triple-network BGP + premium international links (CN2 GIA, CMI, AS9929).
Hong Kong / Singapore
A good compromise: low latency to mainland China (30-80ms) and excellent APAC Cloudflare connectivity.
Avoid cheap VPS
Budget hosts often have severely congested international egress and can drop to a few dozen KB/s at peak hours. Not recommended for CDN-heavy workloads.
Option 4: Relay through another host (last resort)
If your server really can’t reach Cloudflare quickly and you can’t change regions:
Use an overseas server as a relay: download to an overseas box first, then transfer back via a private/premium link
Relay via your own object storage: mirror the asset into your own OSS / COS / S3 (e.g., a China-region bucket), and serve from there
Pre-warm and cache: download once from your backend and serve subsequent requests from a local cache
Mind the expirationCDN URLs returned by API易 for images/videos typically have a limited validity period (see the returned URL). Download and persist assets to your own storage as soon as the callback arrives, to avoid broken links later.
Home broadband often has optimized international routes via your ISP, while cloud servers go through the datacenter’s international egress — quality can vary dramatically. Check your DC’s international bandwidth first and follow the troubleshooting steps above.
I changed DNS but it's still slow — why?
DNS only affects which CDN edge you resolve to. If the underlying international bandwidth is already congested, DNS changes alone won’t help. Consider changing regions or relaying through an overseas host.
Is Cloudflare R2 blocked in mainland China?
Cloudflare is not blocked in mainland China, but international egress can get congested at peak hours and some ISPs take suboptimal routes, so access quality is inconsistent. This is a general cross-border networking issue, not an R2-specific problem.
Video downloads keep failing — what can I do?
Use a downloader that supports resume, like aria2c or wget -c, with reasonable timeouts and retries:
Videos are large (tens to hundreds of MB), and Base64 adds about 33% overhead with no resume support — it’s actually slower and wastes bandwidth. We do not recommend Base64 for large files. Some image endpoints support Base64 responses; see the relevant API docs.
How do I confirm the bottleneck is my network, not the CDN?
Run the same curl test from an overseas host (AWS Tokyo, Singapore, etc.). If it’s fast there but slow on your server, the bottleneck is between your server and Cloudflare — not the CDN itself.