08 / 25 · Traffic and capacity

CDN

A content delivery network serves suitable content from locations closer to users. It can cache public assets and reduce origin traffic. It does not make private or rapidly changing data safe to cache automatically.

What you will practise

  • Follow edge hit/miss paths
  • distinguish public/private responses
  • use versioned asset URLs

Before you start: HTTP response, public asset and cache key.

About 4 minutes · offline-generated English female narration · captions included. Diagrams are conceptual; timings are illustrative.

Download MP4Captions

Listen without the videoDownload audio

The same pre-recorded voice as the video. Starting audio pauses the video, and starting the video pauses audio.

Chapters and full transcript

Let us understand cdn. A publisher places copies of a book in many nearby libraries. A student borrows locally instead of travelling to the printing factory. A personalized sealed letter should not be put on the shared shelf. Similarly, images and versioned scripts differ from private booking responses. A content delivery network serves suitable content from locations closer to users. It can cache public assets and reduce origin traffic. It does not make private or rapidly changing data safe to cache automatically.

Follow the normal path. A visitor requests a public poster. The content delivery network routes the request to a suitable edge location rather than always going directly to the origin. If the edge has a valid copy, it returns that representation. This can reduce both response latency and repeated origin transfer. SeatSpot posters and JavaScript bundles are useful near visitors. The booking API still needs authorization, correct seat state and an explicit cache policy.

Now change one condition. A missing or expired representation needs an origin fetch. The origin and its network path still matter for uncached work. A common misunderstanding is this: A CDN removes the origin from every request. Cache misses and dynamic requests still depend on the origin. Think about this. Can an account response use the same public cache policy as a versioned stylesheet? Pause the video and make your prediction. No. Private representations need deliberate cache keys and policies. Shared caching can leak another user’s response.

Let us reason with a concrete example. An illustrative 1 MB poster is requested 10,000 times. Uncached origin transfer would be about 10 GB in decimal units. A 90% edge hit rate would reduce those origin payload reads to roughly 1 GB, ignoring overhead and refresh behavior. Use explicit public asset policies and versioned filenames; treat booking/account routes separately. Costs, topology and actual hit rate depend on the provider and workload. These figures are teaching examples, not production guarantees.

Turn the idea into a design decision. When asset bytes change, publish a new content-versioned name. Long-lived immutable caching only fits a URL whose content will not change. An account or booking response may be personal and time-sensitive. Do not place it on the shared public cache path without a deliberately safe policy. When you try the practice task, look for this result. A content-hashed public file is a suitable immutable candidate; the account statement is not.

Check your understanding. Compare edge hits, misses and private requests separately. A fast cached poster does not show whether the booking API meets its latency and correctness objectives. Here is a challenge. A new logo is uploaded at the old immutable URL but users see the previous one. What is a safer release approach? Pause before the answer. Deploy the new asset under a content-versioned URL and update references. Confirm the production deployment, response headers and edge behavior; invalidate legacy copies if necessary. For an interview, defend cache keys, expiry and invalidation. Say what you would measure, not only which tool you would buy.

Start with an everyday picture

A publisher places copies of a book in many nearby libraries. A student borrows locally instead of travelling to the printing factory. A personalized sealed letter should not be put on the shared shelf. Similarly, images and versioned scripts differ from private booking responses.

Why SeatSpot needs this

SeatSpot posters and JavaScript bundles are useful near visitors. The booking API still needs authorization, correct seat state and an explicit cache policy.

Trace one step at a time

Move through the diagram at your pace. Teal paths are active; unavailable components are labelled.

Nearby visitorEdge cacheOriginVersioned assetPrivate API

Step 1 of 6 · Distance affects latency

Choose the route

A visitor requests a public poster. The content delivery network routes the request to a suitable edge location rather than always going directly to the origin.

Read all six mechanism steps
  1. Choose the route

    A visitor requests a public poster. The content delivery network routes the request to a suitable edge location rather than always going directly to the origin.

  2. Return a cached asset

    If the edge has a valid copy, it returns that representation. This can reduce both response latency and repeated origin transfer.

  3. Fetch on a miss

    A missing or expired representation needs an origin fetch. The origin and its network path still matter for uncached work.

  4. Use a versioned URL

    When asset bytes change, publish a new content-versioned name. Long-lived immutable caching only fits a URL whose content will not change.

  5. Separate private data

    An account or booking response may be personal and time-sensitive. Do not place it on the shared public cache path without a deliberately safe policy.

  6. Measure each path

    Compare edge hits, misses and private requests separately. A fast cached poster does not show whether the booking API meets its latency and correctness objectives.

Pause and make a prediction

Can an account response use the same public cache policy as a versioned stylesheet?

Answer aloud or write your reasoning in the lesson notes before revealing the explanation.

Correct a common misunderstanding

Claim to question: A CDN removes the origin from every request.

Better explanation: Cache misses and dynamic requests still depend on the origin.

Classify cacheable responses

A paper or whiteboard task. No cloud account or paid infrastructure is required.

  1. List a hashed CSS file, event poster and account statement.
  2. Assign public immutable or private/no-store policies with reasons.
  3. Change one asset and decide whether its URL must change.

Check what you can explain

This is your self-check, not an automated grade. Try again without the diagram tomorrow.

0 of 3 goals checked. Choose one remaining idea to practise next.

These checkboxes reset when you leave. Use your saved lesson notes and completion marker to record lasting progress.

Teach it back

Without looking, explain what this component changes, what it does not solve and what happens if it fails. Use the animation to check your explanation, then switch to Engineering.

Try it before viewing the solution

A new logo is uploaded at the old immutable URL but users see the previous one. What is a safer release approach?

Check one key idea

Which asset suits immutable public caching?

Your explanation and interview notes

Saved only in this browser when storage is available. Export a backup from the course page before clearing browser data or moving devices.

Loading your local notes…

Official references and next reading

The explanation, fictional examples and animations are original teaching material. Vendor behavior depends on the specific product/version; use its documentation before deploying.