CDN Mid

1 / 34

In the context of a CDN, what is the 'Last Mile' vs. the 'Middle Mile' problem?

Select the correct answer

1

Last mile is the edge-to-origin hop; middle mile is the user's connection to their local ISP.

2

Last mile is the origin's database query; middle mile is the cache lookup performed at the edge.

3

Last mile is the TLS handshake time; middle mile is the time spent rendering content in browser.

4

Last mile is the user-to-edge link; middle mile is the path from edge to the origin server.

When would you NOT want to use a CDN for a specific type of data or application?

Select the correct answer

1

When large media files must reach users located far from the origin server.

2

When serving static assets to a globally distributed audience across many regions.

3

When traffic is bursty and you need to absorb sudden spikes in user demand.

4

When content is unique per user and rarely reused, caching gives little benefit.

What are the primary tradeoffs of adding a CDN to your stack?

Select the correct answer

1

Better security traded against guaranteed downtime and total loss of analytics.

2

Faster delivery traded against added cost, complexity, and cache staleness risk.

3

Cheaper hosting traded against higher latency and frequent complete origin outages.

4

Slower delivery traded against lower cost, simpler setup, and always-fresh data.

How does a CDN reduce origin bandwidth and load, and how would you quantify the offload it provides?

Select the correct answer

1

Edge serves cached hits; offload is measured by the cache hit ratio of bytes served.

2

Edge rewrites requests; offload is measured by the number of edge POPs deployed.

3

Origin shards traffic; offload is measured by the total concurrent user connections.

4

Origin compresses responses; offload is measured by the average response time gain.

Can a CDN accelerate dynamic (non-cacheable) content? Explain 'Dynamic Site Acceleration' (DSA).

Select the correct answer

1

Yes; DSA optimizes the network path and connections rather than caching content.

2

Yes; DSA caches dynamic responses briefly at edge to serve repeat visitors fast.

3

No; DSA only compresses payloads at the origin before sending them across the wire.

4

No; dynamic content cannot be accelerated because it is never cacheable at edge.

How do CDNs perform 'Image Optimization' at the edge (e.g., WebP conversion, resizing) and why is it better than doing it on the fly at the origin?

Select the correct answer

1

Edge compresses files once at origin upload, requiring manual variant generation later.

2

Origin transforms each request live, which the edge caches but never offloads CPU from.

3

Edge transforms and caches variants near users, sparing origin CPU and cutting latency.

4

Edge stores only original files and resizes inside each user's browser on demand.

Explain how 'Signed URLs' or 'Signed Cookies' work to protect premium/private content delivered via CDN.

Select the correct answer

1

They redirect users to an auth server that issues a session token before any content is ever served.

2

They embed a cryptographic signature and expiry that the edge validates before serving the content.

3

They place the user credentials in the URL so the origin re-verifies each request against its store.

4

They encrypt the file contents end-to-end so only clients holding the decryption key can view them.

What is the role of a Web Application Firewall (WAF) when deployed at the CDN edge compared to a WAF on the application server?

Select the correct answer

1

An edge WAF removes the need for any origin security because traffic is already fully authenticated.

2

An edge WAF only inspects TLS handshakes while the origin WAF decrypts and scans the full payload.

3

An edge WAF filters malicious requests near users before they reach origin, cutting load and latency.

4

An edge WAF caches the blocked requests so that repeated attacks are served faster from edge cache.

When would you use 'Signed URLs' versus 'Signed Cookies' for content protection?

Select the correct answer

1

Use signed URLs for streaming video segments; use signed cookies for static image and CSS assets.

2

Use signed URLs for many files at once; use signed cookies only for one-time single-file downloads.

3

Use signed URLs for a single file; use signed cookies to grant access to many files at once.

4

Use signed URLs when content is public; use signed cookies when content must be encrypted at rest.

What is rate limiting at the edge, and why is enforcing it at the CDN more effective than at the origin?

Select the correct answer

1

It queues excess requests at the origin and replays them slowly once traffic returns to normal.

2

It caps request rates per client at the edge, stopping abuse before it reaches origin resources.

3

It caps the origin's outbound bandwidth so the server never exceeds its provisioned transfer limit.

4

It throttles only cached responses at the edge while sending uncached requests straight to origin.

What is bot management, and how does a CDN distinguish and mitigate malicious bots at the edge?

Select the correct answer

1

It inspects only the User-Agent string and trusts any request claiming to be a search engine.

2

It relies solely on a static IP blocklist updated nightly to drop traffic from known bad networks.

3

It identifies bots via fingerprinting, behavior, and challenges, blocking malicious ones at the edge.

4

It blocks every automated client by default, forcing all bots including crawlers to register a key.

How do you define and measure 'Cache Hit Ratio', and what are three common reasons it might be lower than expected?

Select the correct answer

1

Hits divided by origin requests; lowered by large objects, bandwidth caps, and DNS issues.

2

Misses divided by total requests; lowered by long TTLs, shared keys, and rare purges.

3

Hits divided by total requests; lowered by short TTLs, fragmented keys, and frequent purges.

4

Edge bytes over total bytes; lowered by TLS overhead, gzip cost, and slow origins.

How do you debug a 'Cache Miss' that you expected to be a 'Cache Hit'? Walk me through your diagnostic process.

Select the correct answer

1

Restart the origin server, clear the browser cache, and increase origin memory allocation.

2

Disable caching entirely, then re-enable it and monitor the origin CPU for spikes.

3

Upgrade the CDN plan, add more edge locations, and enable HTTP/2 on the origin server.

4

Inspect cache headers, then verify the cache key, TTL, and Vary configuration.

What is 'Cache Hit Ratio' (CHR) and what are three specific ways you can improve it?

Select the correct answer

1

Ratio of bytes to objects; improve via image compression, minification, and tiered caches.

2

Ratio of origin to edge hits; improve via more POPs, faster DNS, and TLS session reuse.

3

Ratio of misses to requests; improve via shorter TTLs, unique keys, and frequent purging.

4

Ratio of hits to requests; improve via longer TTLs, normalized keys, and cacheable responses.

If a user reports a slow site but the origin server has low CPU/RAM usage, how would you use CDN logs to investigate?

Select the correct answer

1

Analyze origin logs for slow SQL queries, thread pools, and garbage collection pauses.

2

Analyze DNS logs for resolution delays, TTL expiry, and recursive resolver failures.

3

Analyze edge logs for cache miss rates, TTFB, status codes, and per-region latency.

4

Analyze browser logs for render-blocking scripts, layout shifts, and paint timings.

Explain the 'Vary' header. How does it influence how a CDN stores and serves different versions of a resource?

Select the correct answer

1

It instructs caches how long to retain a resource before revalidating with origin.

2

It instructs caches to bypass storage entirely and always fetch from the origin.

3

It instructs caches to compress responses based on the client's bandwidth limit.

4

It instructs caches to store separate variants keyed by the listed request headers.

What is a 'Cache Key' and how do query strings or headers like User-Agent affect cache fragmentation?

Select the correct answer

1

Identifier for a cached object; including query strings or User-Agent multiplies variants.

2

Compression setting for a cached object; query strings and User-Agent shrink each variant.

3

Expiration timer for a cached object; query strings and User-Agent extend its lifetime.

4

Encryption token for a cached object; query strings and User-Agent secure each variant.

What is 'Negative Caching' and why is it important for a CDN?

Select the correct answer

1

Caching only successful responses and dropping all error codes so clients always retry against the origin

2

Storing stale copies of objects so they can be served whenever the origin becomes completely unreachable

3

Caching error responses like 404 or 500 briefly to shield the origin from repeated failing requests

4

Refusing to cache any content from origins that have previously returned slow or failing responses to users

Explain 'Cache Key Normalization'. Why would you want to strip certain query parameters at the edge?

Select the correct answer

1

Removing irrelevant params (e.g. tracking tags) so equivalent URLs map to one cache entry, raising hit ratio

2

Encrypting query parameters before they are stored so that the cache key cannot leak sensitive user data

3

Adding extra parameters to each URL so every visitor receives a uniquely personalized cached response object

4

Sorting query parameters alphabetically so the origin can validate request signatures more reliably at scale

Explain the difference between a 'Hard Purge' and a 'Soft Purge' (Invalidation vs. Revalidation).

Select the correct answer

1

Hard purge applies to static assets and soft purge applies exclusively to dynamic API responses on the edge

2

Hard purge removes objects after their TTL expires while soft purge removes them before the TTL has elapsed

3

Hard purge deletes content immediately; soft purge marks it stale so it is revalidated on next request

4

Hard purge clears only the origin's cache while soft purge clears every edge node's cache simultaneously fast

Explain the 'stale-while-revalidate' directive and how it improves the user experience compared to a standard TTL.

Select the correct answer

1

It blocks the user request at the edge until the origin confirms the content is still fresh and unchanged

2

It serves stale content instantly while asynchronously fetching a fresh copy, avoiding latency on expiry

3

It extends the original TTL by a fixed window so the object never actually expires until traffic stops

4

It revalidates every cached object on a background timer regardless of whether any user has requested it

What is the difference between Cache Invalidation (Purging) and Cache Expiration (TTL), and which is more expensive for a global CDN?

Select the correct answer

1

Both rely on the same TTL timer internally, so neither is more expensive than the other at global scale

2

Expiration actively pushes removals to all nodes while purging waits for the TTL, making expiration costlier

3

Expiration removes content passively by time; purging actively forces removal across edges and costs more

4

Purging only affects one edge node at a time so it is far cheaper than letting content expire globally

Explain the 'stale-if-error' directive and how a CDN uses it to keep serving content when the origin is unavailable.

Select the correct answer

1

It lets the CDN serve an expired cached copy when the origin returns errors or is unreachable

2

It forces the CDN to purge stale objects immediately whenever the origin begins returning error codes

3

It instructs the CDN to retry the origin repeatedly until a fresh non-error response is finally returned

4

It tells the browser to ignore all cache rules and always fetch content directly from the origin

How does a CDN handle a 'Flash Crowd' or a sudden viral traffic spike without crashing the origin?

Select the correct answer

1

Edges serve most requests from cache and collapse concurrent misses into one origin fetch via request coalescing

2

Edges queue all viral traffic and replay it slowly to the origin once the demand spike has fully subsided

3

Edges forward every incoming request straight to the origin but spread them evenly using round-robin load balancing

4

Edges automatically block a portion of users with rate limits so the origin only ever sees baseline traffic

How would you use a CDN to implement 'Geo-fencing' or localized content delivery?

Select the correct answer

1

Use edge logic on the client's geolocation to serve, redirect, or block content based on country or region

2

Use the browser's stored language preference exclusively, ignoring the client IP and edge location entirely

3

Use origin-only checks that inspect each request's location after the CDN has already returned its cached copy

4

Use a single shared cache key for all regions so every user worldwide receives identical localized content

How does a CDN handle 'Cold Starts' and what is 'Cache Warming'?

Select the correct answer

1

A cold start is a TLS handshake delay, and warming means keeping persistent connections open to every client

2

A cold start is an empty edge cache causing origin fetches; warming pre-loads content so early users hit cache

3

A cold start is an overloaded origin server, and warming means scaling up extra origin capacity in advance

4

A cold start is expired DNS records, and warming means refreshing those records before users begin requesting

What are the performance benefits of terminating TLS/SSL at the edge rather than at the origin?

Select the correct answer

1

The handshake happens close to the user, cutting round-trip latency and offloading crypto work from the origin

2

The certificate is validated only once globally, so individual users avoid repeating any handshake round-trips

3

The handshake is skipped entirely for nearby users, removing all encryption overhead between client and edge

4

The origin handles every handshake but the edge caches the negotiated session keys for all future visitors

How does a CDN use 'Connection Reuse' (Keep-Alive) between the edge and the origin to improve performance?

Select the correct answer

1

It keeps open connections in a pool so subsequent origin fetches skip repeated TCP and TLS handshakes

2

It opens a brand new connection per request but caches the TLS certificate so verification can be skipped

3

It merges many origin requests onto one connection so the origin only ever processes a single response

4

It holds the client browser connection open indefinitely so the origin never needs to respond more than once

What are the tradeoffs of enabling 'Edge Minification' or Brotli/Gzip compression at the CDN layer?

Select the correct answer

1

It cuts payload size and speeds delivery but costs edge CPU and complicates caching of variants.

2

It guarantees smaller payloads at zero CPU cost since edge nodes compress all content for free.

3

It always improves security by encrypting assets while shrinking them before reaching clients.

4

It removes the need for origin compression and never affects cache hit ratios or content types.

What is 'Brotli' or 'Gzip' compression at the edge, and why is it better to do it there than at the origin?

Select the correct answer

1

Compressing at the edge raises origin bandwidth because each request recompresses content fresh.

2

Compressing at the edge offloads origin CPU and reuses compressed cached objects across users.

3

Compressing at the edge replaces caching entirely since compressed files never need revalidation.

4

Compressing at the edge encrypts traffic so the origin never needs to serve TLS to clients.

What is 'Edge Compute' (e.g., Workers/Functions-at-the-Edge), and how does it change the traditional 'static' nature of a CDN?

Select the correct answer

1

It caches database queries at the edge so origins no longer process any dynamic requests at all.

2

It compresses static assets automatically at every edge so dynamic content is never required again.

3

It moves the entire backend server into each edge node, replicating databases globally for writes.

4

It runs custom code on edge nodes, letting CDNs handle dynamic logic instead of only static files.

What is 'Edge Compute' (or Edge Functions) and what logic is appropriate to move from the backend to the edge?

Select the correct answer

1

Stateful session management requiring strong consistency and frequent writes to shared storage.

2

Heavy database joins and long transactions that need consistent access to a central data store.

3

Large batch jobs and analytics pipelines that process gigabytes of data over many long minutes.

4

Lightweight stateless tasks like auth, redirects, and header rewrites that benefit from low latency.

When would you use an Edge Function to modify a request/response instead of doing it at the origin?

Select the correct answer

1

When changes require complex queries against the primary database before responding to the client.

2

When changes must run only once globally and stay strongly consistent across every region instantly.

3

When changes need low latency near users and don't require origin data, like redirects or headers.

4

When changes involve large file processing and long-running computation tied to backend resources.

When would you use an 'Edge Function' versus a traditional serverless function?

Select the correct answer

1

Edge functions support longer execution and larger memory; serverless is limited to short bursts only.

2

Edge functions are stateful and cached; serverless functions are stateless and never reused at all here.

3

Edge functions always access databases faster; serverless cannot connect to any persistent data store.

4

Edge functions run globally near users with tight limits; serverless runs regionally with more resources.