The document discusses how content delivery networks (CDNs) have evolved to better handle dynamic and unpredictable content. Traditionally, CDNs focused on static content and treated dynamic content as uncacheable. However, some dynamic content can actually be cached for periods of time. Modern CDNs now provide more granular caching controls and real-time APIs to allow custom caching configurations specified by the application. This improves cache hit ratios, offloads origin servers, and enhances performance even for long-tail content that changes infrequently.
7. Classic
CDNs
• Black
box
service
• Making
changes
sucked!
• LiRle
to
no
real-‐/me
interfaces
– APIs
or
configura/on
management
• Lots
of
professional
services
• Decent
caching,
terrible
uncaching
27. Today…
• Influenced
by
clouds
• Devops
requires
programmability
and
control
• CDNs
should
be
part
of
the
applica/on
• Real-‐/me
integra/on
– Changes
and
APIs
• Unpredictable
content
expiry
• Your
content
à
you
need
control
64. Three
types
of
content
• Sta/c
– Infrequent
changes,
can
cache
for
a
long
/me
– Cache-‐control
headers
are
good
enough
– Examples:
Images,
javascript
,
css,
etc
• Dynamic
– Can’t
cache
at
all
-‐
must
go
to
origin
– DSA
and
transport
is
key
for
performance
– Examples:
Logins,
credit
card
transac/ons,
Ajax,
etc
• Event-‐driven
– Sta/c,
but
unpredictably
– Cache-‐control
headers
are
not
good
enough
– Examples:
That
news
story,
wiki
pages,
user
comments,
sports
scores,
etc
65. Three
types
of
content
• Sta/c
– Infrequent
changes,
can
cache
for
a
long
/me
– Cache-‐control
headers
are
good
enough
– Examples:
Images,
javascript
,
css,
etc
• Dynamic
– Can’t
cache
at
all
-‐
must
go
to
origin
– DSA
and
transport
is
key
for
performance
– Examples:
Logins,
credit
card
transac/ons,
Ajax,
etc
• Event-‐driven
– Sta/c,
but
unpredictably
– Cache-‐control
headers
are
not
good
enough
– Examples:
That
news
story,
wiki
pages,
user
comments,
sports
scores,
etc
66. Three
types
of
content
• Sta/c
– Infrequent
changes,
can
cache
for
a
long
/me
– Cache-‐control
headers
are
good
enough
– Examples:
Images,
javascript
,
css,
etc
• Dynamic
– Can’t
cache
at
all
-‐
must
go
to
origin
– DSA
and
transport
is
key
for
performance
– Examples:
Logins,
credit
card
transac/ons,
Ajax,
etc
• Event-‐driven
– Sta/c,
but
unpredictably
– Cache-‐control
headers
are
not
good
enough
– Examples:
That
news
story,
wiki
pages,
user
comments,
sports
scores,
etc
67. Caching
event-‐driven
content
• Not
easy
– Classic
CDNs
con/nue
to
consider
it
the
same
as
dynamic
(Bad
caching
or
panic!)
– Need
the
right
tools
to
cache
• You
may
not
know
expiry
ahead
of
/me,
but
your
app
knows
when
things
change
69. Uncaching!
• Purging
– Accessible
through
API
– Granular
• Dependencies
through
labels,
tags,
or
surrogate
keys
– Must
be
instantaneous
• Ex:
news
story,
part
2
70. Instant
Purge
• Enables
caching
of
event-‐driven
content
– Can
deal
with
unpredictable
invalida/on
– As
pages
update/publish,
purge
command
is
sent
to
CDN
• Instant?
– Instant
≠
12
minutes!
– Instant
≠
quick
acknowledgement!
– <1sec
– Determinis/c
and
predictable
114. Programmability
• Granular
Invalida/on
API
• Configura/on
API
• Logic
at
the
Edge
• All
must
be
instantaneous
and
real
/me
115.
116. Control
at
the
Edge
• Moving
app
logic
to
the
edge
• Ex:
VCL
(Varnish
Configura/on
Language)
– Script-‐like
configura/on
for
func/onality
at
the
edge
• Any
mechanism
offered
by
CDN
to
let
you
do
stuff
at
the
edge
is
good
117. Logic
at
the
Edge:
Examples
• Generate
content
at
the
edge
• HTTP
header
manipula/on
• Origin
selec/on
• Caching
rules
• Geo-‐IP
rules
• Forcing
SSL
• Serving
stale
content
– stale-‐while-‐revalidate,
stale-‐while-‐error
• Etc…
126. Real-‐3me
Analy3cs
• Stats
API
• Network
stats
• HTTP
stats
(status
codes,
etc)
• Caching
stats
(hits,
misses,
errors,
etc)
• All
have
to
be
real-‐/me
– Historic
data
is
also
a
must
for
long
term
stats
analysis
127. Logging
• Real
/me!
• Log
streaming
– To
any
logging
des/na/on
endpoint
– Ex:
S3,
FTP,
syslog,
etc
137. Summary
• CDNs
should
be
an
extension
of
your
applica/ons:
– Flexible
caching,
predictable
edge
caching,
and
instant
purging
to
un-‐cache!
– Control
at
the
edge
– Real-‐/me
visibility
and
analy/cs
• Full
real-‐/me
programma/c
interface
is
a
must