Fastly is a Content Delivery Network (CDN) and edge cloud platform that moves computation and caching closer to the end user. Unlike traditional CDNs, Fastly emphasizes programmable edge logic through VCL (Varnish Configuration Language) and more recently WebAssembly (Wasm) and edge computing frameworks.
The edge-first architecture processes requests at the node nearest to the user, allowing developers to programmatically control HTTP requests and responses, routing, and caching directly at the edge, while real-time purging ensures that updates are propagated within seconds rather than minutes or hours.
Fastly’s edge architecture consists of several core components,
a. POPs (Points of Presence):
- Distributed globally (~250+ POPs).
- Each POP handles requests, applies caching and logic, reducing latency.
- Designed to support high concurrency and low-latency responses.
b. Edge Caching:
- HTTP caching: Standard HTTP cache headers (Cache-Control, ETag, Surrogate-Control).
- Instant purge: Unlike traditional CDNs, you can purge content instantly across all POPs.
- Stale-while-revalidate: Allows serving stale content while fetching new content from origin.
c. Edge Compute:
- VCL (Varnish Configuration Language): Original way to write edge logic, manipulating headers, requests, and responses.
- Compute@Edge (serverless functions at edge): Allows deploying custom logic in languages like JavaScript, Rust, and Go.
- WebAssembly (Wasm): Lightweight modules that run at edge nodes for high-performance logic.
d. Security at the Edge:
- DDoS protection through POPs absorbing malicious traffic.
- WAF (Web Application Firewall) integrated with edge logic.
- TLS termination at edge nodes.
How Fastly Edge Works in Practice
When a request reaches the nearest point of presence (POP), Fastly routes it to the closest edge node, where edge logic—using VCL or Compute@Edge scripts—inspects and manipulates the request or response. The edge performs a cache lookup, serving content directly if it’s valid; if not, it fetches from the origin only when necessary. Before returning the response to the user, the edge can apply transformations such as compression, header injection, or A/B testing. This architecture significantly reduces latency, decreases origin load, and enables custom logic for each request.
Edge Observability & Analytics
Fastly offers real-time logging and observability, providing metrics such as bandwidth, cache hit/miss rates, and errors, while enabling edge logging that can be sent to third-party systems like Datadog, Splunk, or S3. Additionally, Fastly Insights allows edge debugging by tracing request performance across all points of presence (POPs), giving developers full visibility into their applications in real time.
Use Cases for Deeper Edge Logic
Fastly Edge is ideal for scenarios requiring dynamic content acceleration, such as personalized pages and A/B testing, as well as enhanced security at the edge with WAF, bot detection, and DDoS mitigation. It supports API acceleration through edge caching and transformations for GraphQL and REST APIs, enables serverless functions closer to users for low-latency applications, and optimizes streaming and media delivery, allowing video and audio content to be served with minimal origin hits.