Skip to main content
CDN

CDN

How Easel's delivery network routes, caches, and compresses responses for every deployment.

Every Easel deployment is served through a global delivery network. It routes each request to the right deployment and resource, serves static files and cached responses without running your code, and compresses what it returns. For the full request path from DNS to your function, see How Easel works.

Not every request invokes application code.

A request can finish at a firewall rule, a redirect, a cached response, or a static file without invoking a function. Firewall and challenge rules run first; their order is covered in Security.

What the CDN does for every deployment:

  • Static files. Build output is deployed as versioned assets and served without compute. See Static files.
  • Response caching. Pages and API responses with a shared-cache policy are reused across requests. See Caching and Revalidation.
  • Compression. Eligible responses are sent with Brotli or gzip. See Compression.
  • Diagnostics. Every response carries X-Easel-Id and, where relevant, X-Easel-Cache. See Headers.
  • HTTPS. Certificates are issued and renewed for deployment URLs and custom domains. See HTTPS.

Function compute runs in one region, separate from the edge locations that serve cached and static content. See Regions.

Routing

Host routing

The request hostname picks the deployment:

  • A unique deployment URL serves that one immutable deployment.
  • A branch or pull request URL serves the latest ready deployment for that branch.
  • A production domain serves the Current production deployment.

URL types are covered in Deployment URLs.

Evaluation order

After the host selects a deployment and security rules run, Easel applies the routes your framework generates at build time, in this order:

Host selects deployment
  ↓
Security (firewall, attack challenge mode)
  ↓
Redirects and custom headers
  ↓
Framework middleware, when present
  ↓
Static files and prerendered pages
  ↓
Rewrites
  ↓
Dynamic routes (functions)
  ↓
Not found
  • Redirects return a 3xx response before any route runs.
  • Middleware can rewrite, redirect, or respond before the final route. Matchers and runtime support depend on the framework.
  • Static files that exist in the build output are served directly, without a function.
  • Rewrites change the internal destination while the visitor's URL stays the same. Frameworks that support it can rewrite before the static lookup (Next.js beforeFiles) or after dynamic routes miss (fallback).
  • Dynamic routes run in a function. Route precedence comes from the framework's route manifest.

A cacheable response for the resolved route is served from the CDN cache when one is fresh. See Redirects and rewrites.

Trailing slashes

Your framework decides whether paths end in a slash (for example, Next.js trailingSlash) and generates the redirect between the two forms. Don't add a second rule that redirects the other way, or requests loop.

CDN cache and Runtime Cache

Easel has two caches. An application can use both: a route reads data from the Runtime Cache, then the finished response is stored in the CDN cache.

CDN cacheRuntime Cache
Stores complete HTTP responsesStores values inside your function
Checked before your code runsCalled from your code
Controlled by response cache headersControlled by the Runtime Cache API

See Runtime Cache.