Fastly

On this page 7

Fastly is an edge cloud platform and content delivery network (CDN) that caches, routes and processes web traffic on servers placed close to users, so that websites, APIs and streaming services respond faster and shed load from their origin servers. In content delivery on the Internet, Fastly is best known for programmable caching logic, near-instant cache purging and edge compute based on WebAssembly, which together make it popular with publishers, e-commerce platforms and API-heavy services.

Founded in 2011 and publicly listed since 2019, the company grew out of the Varnish Cache ecosystem. Its design favors developer control over configuration: engineers describe caching, routing and security behavior as code rather than selecting options in a fixed menu.

How the Fastly edge network handles a request

A request to a site behind Fastly is routed by DNS and anycast to a nearby point of presence (POP), where an edge server checks its cache for a stored copy of the object. If the object is fresh, the edge returns it immediately as a cache hit; if not, the edge fetches it from the origin server or from an intermediate shield POP, stores it and serves it.

Fastly has historically built fewer but larger POPs with high-capacity servers and fast solid-state storage. The reasoning is that a large POP holds a bigger working set of objects, which raises the cache hit ratio compared with many small sites that each hold only a fraction of the catalog. The trade-off is that some users sit slightly farther from the nearest POP than they would on a network with more locations.

The following table summarizes the main stages of request handling and the Fastly feature that governs each stage.

StageWhat happensControlling feature
RoutingClient reaches the nearest POPAnycast and DNS steering
Cache lookupEdge computes the cache key and checks storageVCL or Compute logic
ShieldingMisses go to one designated shield POPOrigin shield setting
Origin fetchShield requests the object from the backendBackend and health checks
DeliveryObject is stored and returned with headersCache-Control and Surrogate-Control
Request path through the Fastly platform

Programmable configuration with VCL and Compute

Fastly offers two programming models, and the choice between them shapes how a team builds its edge logic. The original model uses Varnish Configuration Language (VCL), a domain-specific language with defined subroutines such as vcl_recv, vcl_fetch and vcl_deliver that run at fixed points in the request lifecycle. VCL lets engineers rewrite URLs, normalize headers, choose backends and alter the cache key without touching the origin.

The newer model, Fastly Compute, runs code compiled to WebAssembly inside isolated sandboxes on edge servers. Developers write in languages such as Rust, JavaScript or Go, and each request gets a fresh sandbox that starts in microseconds rather than milliseconds. This design avoids the cold-start delay common in container-based serverless platforms and strongly isolates one request from another.

AspectVCL servicesCompute services
LanguageDomain-specific VCLRust, JavaScript, Go and other Wasm targets
Execution modelFixed lifecycle subroutinesGeneral-purpose program per request
Typical useCaching rules, redirects, header logicPersonalization, API logic, authentication
IsolationShared Varnish processSeparate WebAssembly sandbox per request
Learning curveLow for HTTP specialistsHigher, but uses familiar languages
Comparison of the two Fastly programming models

Both models are deployed through versioned service configurations. Each change creates a new version that can be validated, activated globally within seconds and rolled back to a previous version if errors appear.

Instant purge and cache control features

Instant purge is the capability most closely associated with Fastly: a purge request propagates across the global network in roughly 150 milliseconds under normal conditions. Fast invalidation allows teams to cache content that changes often, such as news articles, prices or inventory pages, because outdated copies can be removed almost immediately after an update.

Purging is most powerful when combined with surrogate keys, Fastly’s implementation of the cache tag concept. The origin attaches a Surrogate-Key header listing labels such as a product ID or author name, and a single purge by key removes every object carrying that label at once. Fastly also supports soft purge, which marks content stale instead of deleting it, so that stale-while-revalidate and stale-if-error rules can still serve the old copy while a fresh one is fetched.

MethodScopeBest suited for
Single URL purgeOne objectCorrecting one changed page or file
Surrogate key purgeAll objects with a tagUpdating a product across many pages
Soft purgeMarks objects staleProtecting the origin during updates
Purge allEntire service cacheEmergencies and major redesigns
Purge methods and when to use them

Further cache features include request collapsing, which merges simultaneous misses for the same object into one origin fetch, the separate Surrogate-Control header for edge-only caching rules, and careful handling of the Vary header to avoid fragmenting the cache.

How Fastly compares with other CDN providers

Fastly competes mainly with Cloudflare, Akamai and Amazon CloudFront, and each provider reflects a different philosophy. Fastly emphasizes configurability, observability and fast invalidation, while competitors differ in network size, bundled services and pricing models. Rankings by raw speed vary by region, workload and measurement method, so no single provider is fastest everywhere.

ProviderDistinctive strengthTypical customer profile
FastlyProgrammable edge and instant purgePublishers, e-commerce, API platforms
CloudflareVery large network and bundled securitySites of every size, including free tiers
AkamaiLong history and enterprise media deliveryLarge enterprises and broadcasters
Amazon CloudFrontTight integration with AWS servicesWorkloads already hosted on AWS
Positioning of major CDN providers

Many large organizations use a multi-CDN strategy that combines Fastly with another provider. This approach improves resilience and lets traffic be steered toward whichever network performs best in a given market.

Security, observability and operational risks

Beyond caching, Fastly provides TLS termination, DDoS mitigation and a next-generation web application firewall derived from its acquisition of Signal Sciences in 2020. Real-time log streaming sends request logs to analytics and storage endpoints within seconds, which helps teams debug cache behavior and detect attacks quickly.

The main operational risk of any centralized CDN is concentration of failure. On 8 June 2021, a valid configuration change by one customer triggered a latent software bug that caused most of the Fastly network to return errors, briefly taking down major news, government and retail sites. Service recovered within about an hour, but the incident became a reference case for why multi-CDN and origin fallback planning matter.

  • Misconfigured cache keys can serve one user’s personalized content to another user.
  • Overly short TTLs reduce the hit ratio and push unnecessary load to the origin.
  • Untested VCL changes should be staged on a separate service version before activation.
  • Missing shielding multiplies origin requests because every POP fetches independently.

Put simply

Fastly runs a worldwide network of computers that keep copies of websites close to the people visiting them. When someone opens a page, the nearest Fastly computer answers instead of a distant main server, so the page loads faster and the main server does less work.

What sets Fastly apart is control. Website owners can write their own rules for how those copies behave, and they can erase outdated copies everywhere in a fraction of a second. It is like a chain of local libraries that can recall an old edition of a book from every branch almost at once.

In practice

A national news publisher serves about 40 million page views a day, with traffic spikes of ten times normal volume during breaking stories. Its engineers place Fastly in front of the content management system, cache article pages for 24 hours at the edge and tag each page with surrogate keys for the article ID, section and author.

When an editor corrects a headline, the publishing system sends one surrogate key purge, and every cached version of that article, its section front and related lists refreshes worldwide within a second. Shielding through a single POP near the origin and request collapsing mean that a breaking story generates only a handful of origin requests instead of thousands.

The outcome is a cache hit ratio above 95 percent for article traffic, faster page loads for readers and an origin cluster that no longer needs emergency scaling during major news events.