WEBVTT

1
00:00:00.000 --> 00:00:04.580
Let us understand cdn. A
publisher places copies of a book

2
00:00:04.580 --> 00:00:08.980
in many nearby libraries. A
student borrows locally instead

3
00:00:08.980 --> 00:00:10.640
of travelling to the printing factory.

4
00:00:11.440 --> 00:00:14.340
A personalized sealed letter
should not be put on the shared

5
00:00:14.340 --> 00:00:18.280
shelf. Similarly, images and
versioned scripts differ from

6
00:00:18.280 --> 00:00:22.460
private booking responses. A
content delivery network serves

7
00:00:22.460 --> 00:00:25.320
suitable content from
locations closer to users.

8
00:00:26.040 --> 00:00:29.280
It can cache public assets
and reduce origin traffic.

9
00:00:29.280 --> 00:00:33.540
It does not make private or
rapidly changing data safe to

10
00:00:33.540 --> 00:00:37.160
cache automatically.
Follow the normal path.

11
00:00:37.600 --> 00:00:39.560
A visitor requests a public poster.

12
00:00:40.380 --> 00:00:43.380
The content delivery network
routes the request to a

13
00:00:43.380 --> 00:00:47.060
suitable edge location rather
than always going directly to

14
00:00:47.060 --> 00:00:51.380
the origin. If the edge has
a valid copy, it returns that

15
00:00:51.380 --> 00:00:55.420
representation. This can reduce
both response latency and

16
00:00:55.420 --> 00:00:59.740
repeated origin transfer.
SeatSpot posters and JavaScript

17
00:00:59.740 --> 00:01:03.820
bundles are useful near
visitors. The booking API still

18
00:01:03.820 --> 00:01:07.520
needs authorization, correct
seat state and an explicit

19
00:01:07.520 --> 00:01:10.920
cache policy. Now change one condition.

20
00:01:11.640 --> 00:01:15.120
A missing or expired representation
needs an origin fetch.

21
00:01:15.700 --> 00:01:18.940
The origin and its network
path still matter for uncached

22
00:01:18.940 --> 00:01:23.900
work. A common misunderstanding
is this: A CDN removes the

23
00:01:23.900 --> 00:01:28.260
origin from every request. Cache
misses and dynamic requests

24
00:01:28.260 --> 00:01:31.640
still depend on the
origin. Think about this.

25
00:01:31.760 --> 00:01:35.160
Can an account response use
the same public cache policy as

26
00:01:35.160 --> 00:01:38.420
a versioned stylesheet?
Pause the video and make your

27
00:01:38.420 --> 00:01:42.520
prediction. No. Private
representations need deliberate

28
00:01:42.520 --> 00:01:46.320
cache keys and policies.
Shared caching can leak another

29
00:01:46.320 --> 00:01:50.640
user’s response. Let us reason
with a concrete example.

30
00:01:50.640 --> 00:01:55.720
An illustrative 1 MB poster
is requested 10,000 times.

31
00:01:55.720 --> 00:02:00.200
Uncached origin transfer would
be about 10 GB in decimal

32
00:02:00.200 --> 00:02:04.860
units. A 90% edge hit rate would
reduce those origin payload

33
00:02:04.860 --> 00:02:09.400
reads to roughly 1 GB,
ignoring overhead and refresh

34
00:02:09.400 --> 00:02:13.580
behavior. Use explicit public
asset policies and versioned

35
00:02:13.580 --> 00:02:16.980
filenames; treat booking/account
routes separately.

36
00:02:16.980 --> 00:02:21.300
Costs, topology and actual hit
rate depend on the provider

37
00:02:21.300 --> 00:02:25.260
and workload. These figures
are teaching examples, not

38
00:02:25.260 --> 00:02:29.500
production guarantees. Turn the
idea into a design decision.

39
00:02:30.000 --> 00:02:33.340
When asset bytes change,
publish a new content-versioned

40
00:02:33.340 --> 00:02:38.120
name. Long-lived immutable
caching only fits a URL whose

41
00:02:38.120 --> 00:02:42.200
content will not change. An
account or booking response may

42
00:02:42.200 --> 00:02:45.860
be personal and time-sensitive.
Do not place it on the

43
00:02:45.860 --> 00:02:49.280
shared public cache path without
a deliberately safe policy.

44
00:02:49.860 --> 00:02:52.700
When you try the practice
task, look for this result.

45
00:02:53.440 --> 00:02:56.600
A content-hashed public
file is a suitable immutable

46
00:02:56.600 --> 00:02:59.560
candidate; the account statement is not.

47
00:03:00.260 --> 00:03:03.660
Check your understanding.
Compare edge hits, misses and

48
00:03:03.660 --> 00:03:07.640
private requests separately.
A fast cached poster does not

49
00:03:07.640 --> 00:03:10.820
show whether the booking
API meets its latency and

50
00:03:10.820 --> 00:03:13.540
correctness objectives.
Here is a challenge.

51
00:03:14.120 --> 00:03:18.060
A new logo is uploaded at the
old immutable URL but users

52
00:03:18.060 --> 00:03:21.580
see the previous one. What
is a safer release approach?

53
00:03:21.900 --> 00:03:25.420
Pause before the answer.
Deploy the new asset under a

54
00:03:25.420 --> 00:03:28.160
content-versioned URL
and update references.

55
00:03:29.000 --> 00:03:32.140
Confirm the production deployment,
response headers and edge

56
00:03:32.140 --> 00:03:35.280
behavior; invalidate
legacy copies if necessary.

57
00:03:36.000 --> 00:03:39.300
For an interview, defend
cache keys, expiry and

58
00:03:39.300 --> 00:03:42.720
invalidation. Say what you
would measure, not only which

59
00:03:42.720 --> 00:03:43.540
tool you would buy.
