What is Cloudflare and why do better sites use it?
Cloudflare is a network infrastructure company with a global CDN (Content Delivery Network) with a presence in over 300 cities around the world. This means that when a user in Stockholm visits a site that runs on Cloudflare, files are served from Cloudflare's nearest data center - not from a server in, for example, the United States. This significantly reduces loading times.
But Cloudflare is much more than a CDN. There is also DDoS protection, WAF (Web Application Firewall), DNS management, SSL certificates, image optimization, serverless edge computing and data storage via R2 and D1.
Cloudflare Workers – serverless code at the edge of the web
Cloudflare Workers is the most exciting offering for developers. It allows you to run JavaScript/TypeScript code on Cloudflare's global network - at the edge, close to the user - instead of on a central server. The result is extremely low latency for API responses and serverless functions.
The free level of Workers includes 100,000 requests per day at no cost. That's enough for most small and medium-sized projects.
Cloudflare R2 – cheap and GDPR-friendly file storage
Cloudflare R2 is an object storage service comparable to Amazon S3 but with a critical difference: R2 does not charge egress fees. This means that you pay to store data but not to read it out to users. That makes R2 a dramatically cheaper alternative to S3 for publishing images, videos and files via CDN.
R2 is also more GDPR friendly than S3 because Cloudflare offers European data storage with clear DPA agreements.
How ZORC uses Cloudflare
Cloudflare is a central part of our infrastructure for all productions. We use Cloudflare DNS for fast propagation, Cloudflare Pages for static hosting of frontends, R2 for media files and Workers for API logic that needs low latency. It gives us enterprise-level infrastructure without enterprise-level cost.