CDN Edge Computing & Edge Functions 3 — Questions and Answers
Question 1: Which isolation technology do most CDN providers (e.g., Cloudflare Workers, Fastly Compute) use instead of containers for edge functions?
- Docker containers with gVisor
- V8 Isolates (Correct answer)
- Firecracker microVMs
- WebAssembly runtimes with full POSIX support
Correct answer: V8 Isolates
V8 Isolates provide lightweight, low-overhead sandboxing within a single process, enabling fast cold starts compared to containers or full VMs.
Question 2: A CDN edge function must validate a JWT on every request. Where should the signing secret be stored securely?
- Hardcoded in the function source code
- In a platform-provided secrets or environment variable store (Correct answer)
- In a plain-text config file deployed alongside the function
- Encoded in a query parameter sent by the client
Correct answer: In a platform-provided secrets or environment variable store
Secrets must be injected at deploy time via the platform's secure environment variable or secrets management service, never hardcoded in source.
Question 3: What is the purpose of the waitUntil() API available in many edge function runtimes?
- To pause execution until the cache is warmed
- To allow background async work such as logging to continue after the response is sent to the client (Correct answer)
- To delay the response until the origin confirms receipt
- To queue the request for processing during off-peak hours
Correct answer: To allow background async work such as logging to continue after the response is sent to the client
waitUntil() extends the function's lifetime beyond the response so async tasks like analytics or cache warming can complete without blocking the user.
Question 4: An edge function intercepts a request and must forward a custom header to the origin for tracing. Which step is required?
- Modify the response headers before forwarding
- Clone and mutate the Request object, then pass it to fetch() (Correct answer)
- Set the header on the global self object
- Use the CORS preflight to negotiate the header first
Correct answer: Clone and mutate the Request object, then pass it to fetch()
Request objects in edge runtimes are immutable, so you must clone them and append the desired headers before passing to fetch().
Question 5: Which metric best measures the real-world performance improvement gained from moving business logic to the edge?
- Origin server CPU utilization reduction
- Time To First Byte (TTFB) decrease experienced by end users (Correct answer)
- Total number of edge nodes in the network
- CDN cache hit ratio improvement
Correct answer: Time To First Byte (TTFB) decrease experienced by end users
TTFB directly reflects how quickly users receive the first byte of a response, making it the clearest indicator that edge processing reduced latency.
Question 6: What is 'edge-side rendering' (ESR)?
- Rendering HTML inside the browser using WebAssembly
- Generating dynamic HTML responses at the CDN edge node rather than at the origin (Correct answer)
- Pre-rendering pages at build time and caching them at origin
- Rendering only above-the-fold content and deferring the rest
Correct answer: Generating dynamic HTML responses at the CDN edge node rather than at the origin
ESR moves HTML generation to the edge, reducing the round-trip to origin and delivering personalized or dynamic pages with lower latency.
Question 7: A company wants to enforce geo-blocking at the edge to comply with licensing restrictions. Which data source does the edge function typically query?
- The client's GPS coordinates obtained via the Geolocation API
- A MaxMind or equivalent IP-to-country database available on the edge platform (Correct answer)
- The origin server's IP whitelist configuration
- The client's Accept-Language header
Correct answer: A MaxMind or equivalent IP-to-country database available on the edge platform
CDN platforms provide IP geolocation databases (often powered by MaxMind) as built-in metadata on each request, enabling fast country-level decisions.
Which isolation technology do most CDN providers (e.g., Cloudflare Workers, Fastly Compute) use instead of containers for edge functions?