SysPadLessons › CDN and edge lessons › Cloudflare

How Cloudflare works

Cloudflare edge network - CDN, WAF, and reverse proxy in front of your origin. Serves cached responses at the edge (offloading origin traffic) and adds a small edge hop.

Cloudflare puts its enormous global edge network in front of your site as a reverse proxy. Once traffic flows through it, Cloudflare can cache content, block attacks, absorb DDoS, and even run your code at the edge, all before requests reach your origin. It’s a CDN, a security layer, and an edge compute platform rolled into one.

What you will learn

A reverse proxy at the edge

You route your DNS through Cloudflare, so every request reaches its global edge before your origin. From that position it can inspect, cache, transform, and protect traffic, your servers only see what Cloudflare passes through.

CDN and security in one place

At the edge, Cloudflare caches content near users (like any CDN) and simultaneously runs a WAF and DDoS protection, filtering malicious requests and absorbing volumetric attacks across its huge network before they ever hit your origin.

Websites and APIs wanting performance plus security: caching, bot defense, DDoS mitigation, DNS.

Workers and R2: compute and storage at the edge

Workers let you run your own code on Cloudflare’s edge, milliseconds from users, for routing, personalisation, APIs, and more, without managing servers. R2 is object storage that’s S3-compatible but notably charges no egress fees, attractive for serving large amounts of data.

Cloudflare vs CloudFront

Both are global CDNs with edge security and edge compute (CloudFront pairs with WAF/Shield and Lambda@Edge/CloudFront Functions). CloudFront is AWS-native and integrates tightly with AWS origins and services. Cloudflare is an independent network, often chosen for its security features, Workers/R2 (no egress fees), and being cloud-agnostic.

Flashcards

What position does Cloudflare take relative to your origin?
A reverse proxy at the global edge: requests hit Cloudflare first, so it can cache, secure, and transform before your origin sees them.
What does Cloudflare’s edge do for security?
Runs a WAF and DDoS protection, filtering attacks and absorbing volumetric floods across its network before they reach your origin.
What are Workers and R2?
Workers = your code running at the edge near users. R2 = S3-compatible object storage with no egress fees.
What’s the trade-off of edge compute (Workers)?
Very low latency and global, but constrained (short execution, limited runtime), suited to lightweight logic, not heavy long-running jobs.
Cloudflare vs CloudFront, one differentiator each?
CloudFront: deep AWS integration. Cloudflare: independent edge platform, security focus, Workers/R2 (no egress fees), cloud-agnostic.

Sources

Open the SysPad canvas · Official Cloudflare documentation

Other CDN and edge lessons