Learn
Best CDN for Video Streaming in 2026: Full Comparison with Real Performance Data
Best CDN for Video Streaming in 2026: Full Comparison with Real Performance Data If you are choosing the best CDN for ...
A single misconfigured cache-control header cost one SaaS team 340 ms of added TTFB across every dynamic route for eleven days before anyone noticed. The culprit was a conflict between Vercel's default stale-while-revalidate behavior and a Cloudflare cache rule that treated all 200 responses as cacheable for four hours. If you deploy Next.js on Vercel with Cloudflare sitting in front, this class of silent regression is your most likely failure mode in 2026. This article gives you the full production playbook: DNS and proxy wiring, cache-rule architecture that respects ISR and Server Actions, header-conflict resolution, a diagnostics-and-rollback checklist, and the monitoring thresholds that catch regressions before your users do.

Vercel's edge network is optimized for Next.js, but it serves a single purpose: hosting and serverless compute. Cloudflare occupies a different layer. By placing Cloudflare's proxy in front of Vercel, you gain independent control over cache TTLs per path, a global Anycast network with over 310 cities as of Q1 2026, and policy enforcement (rate limiting, bot management, custom response headers) that Vercel's middleware alone cannot replicate at the network edge.
The performance payoff is measurable. Teams running this dual-layer architecture consistently report p50 TTFB under 60 ms for static and ISR pages when Cloudflare returns a cache HIT, compared with 120–180 ms when requests pass through to Vercel's origin functions. For globally distributed audiences, the delta widens further.
Clarity on responsibility boundaries prevents most configuration mistakes.
| Layer | Owner | Responsibility |
|---|---|---|
| DNS + Proxy | Cloudflare | Anycast resolution, TLS termination, cache evaluation, WAF/bot rules |
| Edge Compute | Vercel | Next.js middleware, edge functions, ISR revalidation |
| Origin Compute | Vercel | SSR, Server Actions, API routes, serverless function execution |
| Static Assets | Vercel (served), Cloudflare (cached) | JS/CSS bundles, images, fonts — immutable content-hashed files |
Point your domain's CNAME to cname.vercel-dns.com with Cloudflare's proxy enabled (orange cloud). In Vercel's dashboard, add the custom domain and verify it. As of early 2026, Vercel requires you to enable the "Verified Proxy" integration under Settings → Security. This tells Vercel to trust Cloudflare's connecting IP range and not reject proxied requests or serve challenge pages. Skip this step and you will see intermittent 403 responses.
Set Cloudflare's SSL/TLS mode to Full (Strict). Vercel provisions certificates automatically. Using Flexible mode breaks POST requests and Server Actions because Vercel's origin expects HTTPS.
Cloudflare's default behavior is to respect origin cache-control headers. Vercel sets nuanced headers per route type. The danger is overriding them with broad Cloudflare cache rules. Here is a route-type-aware rule set that works for most Next.js apps in 2026:
| Route Pattern | Cloudflare Cache Rule | Rationale |
|---|---|---|
| /_next/static/* | Cache Everything, Edge TTL 30 days | Content-hashed, immutable. Long TTL is safe. |
| /images/*, /fonts/* | Cache Everything, Edge TTL 7 days | Static media. Purge on redeploy if filenames change. |
| ISR pages (e.g., /blog/*) | Respect Origin, do NOT override TTL | Vercel sends s-maxage + stale-while-revalidate. Overriding breaks ISR. |
| /api/*, Server Actions | Bypass Cache | Dynamic, user-specific, often mutating. Must not be cached. |
| SSR pages with auth | Bypass Cache | Personalized content. Caching leaks data between users. |
The critical rule: never set a Cloudflare Edge TTL on ISR routes. Vercel's ISR machinery uses the stale-while-revalidate window to serve cached content while regenerating in the background. If Cloudflare holds a stale copy past that window, users see outdated content and the revalidation callback never triggers.
Vercel's Next.js integration (as of v15.2, shipping mid-2026) sets these default headers on ISR responses: s-maxage={revalidate}, stale-while-revalidate=31536000. Cloudflare respects s-maxage when no override rule exists. But if your Cloudflare cache rule sets "Edge TTL" explicitly, that value takes precedence. This is where the 340 ms regression from the opening paragraph originated. Audit your rules with the cf-cache-status and age response headers. A HIT with an age exceeding your ISR revalidation interval means Cloudflare is overriding Vercel's intended behavior.
This section is what separates a blog post from a production runbook. When something breaks after enabling Cloudflare in front of Vercel, run through this sequence:
Check cf-cache-status. If HIT, purge the specific URL or use Cloudflare's prefix purge. Verify that Vercel's x-vercel-cache header returns STALE or MISS after deploy — if it returns HIT, the stale object is in Vercel's cache, not Cloudflare's. Purge both layers.
Preview URLs (*.vercel.app) bypass your custom domain. Cloudflare is not involved. If 403s appear on preview URLs, check Vercel's Deployment Protection settings. If they appear on the custom domain, confirm the Verified Proxy integration is active.
Cloudflare is likely caching the response past its s-maxage. Remove any Edge TTL override for the affected path. After correcting, watch the age header over successive requests to confirm it resets after the revalidation interval.
To remove Cloudflare from the path without DNS propagation delay, toggle the proxy status to DNS-only (grey cloud) for the CNAME record. Traffic flows directly to Vercel within seconds. This is your emergency eject button. Practice it before you need it.
Instrument these five signals. Set alerts on them. Review weekly at minimum.
The Cloudflare-in-front-of-Vercel pattern works well up to moderate scale. At high traffic volumes — think tens of terabytes of monthly transfer — the economics shift. Cloudflare's free and Pro tiers impose soft limits on cache purge rates and rule counts. Vercel's bandwidth pricing, while bundled into its plans, becomes material past the included allocation. At that point, separating concerns further makes sense: keep Vercel for compute and deploy your static and media assets through a dedicated CDN optimized for throughput and cost per GB. BlazingCDN fits this role well, delivering fault tolerance and uptime on par with CloudFront at a fraction of the cost — starting at $4 per TB for lower volumes and scaling down to $2 per TB at 2 PB+, with 100% uptime SLA and flexible configuration. For teams pushing serious bandwidth, the savings compound fast.
Set your Cloudflare cache rules to "Respect Origin" for all ISR paths. Do not set an explicit Edge TTL. Vercel's s-maxage and stale-while-revalidate headers must pass through to Cloudflare untouched, or the background regeneration cycle breaks silently.
Yes. As of 2026, Vercel uses this integration to whitelist Cloudflare's IP ranges. Without it, Vercel may intermittently reject proxied requests with 403 errors, especially under high concurrency.
You can. Tiered caching reduces origin pulls by routing cache misses through upper-tier Cloudflare data centers first. Cache Reserve persists objects in R2-backed storage. Both reduce load on Vercel functions. Test carefully with ISR routes to ensure revalidation timing is not extended beyond your acceptable staleness window.
For content-hashed assets under /_next/static, Vercel sets public, max-age=31536000, immutable. These are safe to cache aggressively at any layer. Non-hashed assets like public/ directory files receive shorter TTLs and should be audited individually.
Vercel automatically invalidates its edge cache on each deployment for static and SSR routes. Cloudflare does not know about Vercel deploys. Use Cloudflare's API to trigger a prefix purge on deploy via a post-deploy webhook, or use cache tags if you are on an Enterprise plan. Automating this step is non-optional for production.
No. The two caches serve different purposes. Vercel's edge cache sits closest to the compute origin and handles ISR revalidation semantics. Cloudflare's cache sits closest to the user and handles global distribution. Disabling either one leaves a gap the other does not fully cover.
Pick one ISR route on your production site. Curl it five times from two different regions. Record the cf-cache-status, age, and x-vercel-cache headers on every response. Plot the age value over time and verify it resets at your configured revalidation interval. If it does not, you have a Cloudflare rule override in place. Fix it, re-test, and you have just eliminated the most common latency regression in this stack. Then instrument the five monitoring thresholds above and set alerts. That is a one-afternoon project that prevents the next eleven-day silent regression.
Learn
Best CDN for Video Streaming in 2026: Full Comparison with Real Performance Data If you are choosing the best CDN for ...
Learn
Video CDN Providers Compared: BlazingCDN vs Cloudflare vs Akamai for OTT If you are choosing a video CDN for an OTT ...
Learn
Video CDN Pricing Explained: How to Stop Overpaying for Streaming Bandwidth Video already accounts for 38% of total ...