3. CDNs
offer
a
toolset
• The
black
box
approach
isn’t
always
good
• Configuration
isn’t
trivial
– And
a
lot
still
depends
on
configuration
• Can’t
depend
on
the
CDN
to
solve
all
your
problems
• Don’t
exacerbate
your
problems!
5. Gzipping
Images
• Not
a
very
good
thing
for
performance
– Extra
bytes
– Extra
work
for
the
browser
• But
was
this
the
Surrogate’s
fault?
6. More
Examples
• Bad
caching
headers
– max-‐age,
s-‐maxage
have
a
lot
of
power!
– stale-‐if-‐error
and
stale-‐while-‐revalidate
are
rad!
• Bad
TCP
connection
management
at
origin
• Not
Gzipping
(actual,
compressible
content)
for
origin
fetches
9. What
Is
Dynamic
Content?
• Stuff
that’s
not
static!
• With
web
traffic,
generally
the
base
HTML
– Big
deal
because
it’s
blocking
– And
sometimes
the
largest
object;
longer
download
• Some
AJAX
• More…
18. Dynamic
Content
Caching
Problems
• Serving
stale
pages
– Lack
of
good
invalidation
framework
• Visibility
• Logging
19. CDNs
and
Dynamic
Content
• Generally,
handling
dynamic
content
has
been
a
matter
of
transport
– Middle
mile
optimizations
– TCP
tweaks
• Some
edge
micro
caching,
but
not
easy
• ESI
20. Actually…
• Dynamic
content
is
more
cacheable
than
we
think
• Static
for
short
periods
of
time
• Unpredictable
invalidation
– Standard
HTTP
caching
rules
aren’t
good
enough
• Event-‐driven
Content
21. So
Many
Benefits!
• Performance
– Faster
time
to
first
byte
– Faster
start
render
– Happy
users!
• Offload
– Less
work
for
our
servers
– Less
bandwidth
at
origin
22. What
Would
Make
It
Better?
• Programmatic
Invalidation
– Granular
– Instantaneous
• Control
at
the
edge,
and
not
just
for
web
pages
– Real-‐time
log
files
– Imagine
terminating
beacons
at
the
edge!
24. Client-‐side
Measurement
in
CDNs
• Cache
hit
ratio
– How
do
you
test
and
measure?
• Long
tail
content?
• DNS
and
edge
node
selection
• TTFB
out
of
datacenter
– Memory
hit
vs
disk
hit
vs
mid-‐tier
hit
vs
miss
• RUM
and
synthetic
(Cedexis,
Catchpoint,
etc)
25. Let’s
Test
It!
• 3
Objects
on
the
same
CDN
(anonymous)
– Cedexis
object
– Small
image
from
Alexa
5000
site
– Long
tail
object:
~40
times
every
3-‐4
hours
• Use
Catchpoint
last
mile
clients
in
US
– Test
every
15
minutes
– ~11,500
total
tests
across
all
test
nodes
• Focus
measurement
on:
– Connect
time
(TCP)
– Wait
time
(TTFB)
37. Measurement!
• Not
only
do
I
care
about:
– Cache
hit
rate
– Long
tail
– Measuring
the
right
thing
• Fetching
from
disk
could
suck!
– SSDs!
• Caching
≠
Caching
39. We
Don’t
Cache
As
Much
As
We
Should!
• HTML
and
other
dynamic
content
• Worse
cache
hit
rate
than
we
think
– Especially
for
long
tail
content
• Mobile
Apps,
APIs,
etc
40. Lots
of
Room
• Making
changes
still
sucks
• Can’t
take
some
things
for
granted:
– DNS
– Routing
– TCP
– SCALE!
• Plus:
lots
of
room
to
be
creative
at
the
edge!
46. Fun
at
the
Edge!
• Synthetic
responses
– Example:
node
ID
for
Cedexis
measurements
• Cookie
manipulation
– Remove/inject/replace/recall
• Beacon
termination
– 204
responses
– Real
time
logs
– Awesome!
49. Making
Changes
SUCKS!!
• Configuration
changes
take
way
too
long
– People
are
used
to
making
changes
real-‐time
– CDNs
aren’t
classically
good
at
this
– Phone??
• Purging
is
a
real
problem
– Slow
– Difficult
– Not
granular
enough
51. Non
“web”
Traffic
• Video
– HLS
(HTTP
Live
Streaming)
– HTTP-‐based
small
video
chunks
– Unique
by
URL
• APIs
– Instant
purging
can
let
API
calls
be
cacheable
– Another
example
of
dynamic
content
cached
at
the
edge
• Mobile
Apps
53. The
Influence
of
Clouds
• DevOps
people
like
programmability
and
integration
• The
CDN
is
no
longer
a
black
box
mechanism,
necessarily
• Cliché
Alert:
Content
as
a
Service!
54. Real
Time
Integration
• Tap
in
to
the
CDN:
– Instantaneous
configuration
changes
– Instantaneous
cache
purge
and
invalidation
– Real
time
stats
and
logs
• Infrastructure
as
code
– Expect
extensive
APIs
– Apps
need
to
naturally
extend
to
the
CDN
– Your
content
=>
you
need
control
56. “Still”
• In
the
world
of
FEO
– Webpagetest.org
– RUM
– Synthetic
testing
vendors
• In
the
world
of
CDNs
– Same
as
far
as
client
performance
goes
– Some
new
things…