0Pricing
Caching Strategies: Redis + CDN + Edge Computing · Lesson

Edge Function Triggers & Request Lifecycle

Understand where edge functions hook into the request lifecycle and the trigger points that let you modify requests and responses at the edge.

The Edge Request Lifecycle

When a request reaches a CDN edge, it passes through distinct phases. Edge functions can attach to specific phases to inspect or transform the request and response.

  • Viewer request: as the request arrives
  • Origin request: before fetching from origin
  • Origin response: after origin replies
  • Viewer response: before returning to the user

Viewer Request Trigger

The viewer request trigger runs on every incoming request, even cache hits. Use it for lightweight logic like redirects, header normalization, or A/B routing.

All lessons in this course

  1. Edge Caching for Dynamic Content
  2. Serverless Functions at the Edge
  3. Deploying Edge Functions
  4. Edge Function Triggers & Request Lifecycle
← Back to Caching Strategies: Redis + CDN + Edge Computing