►
From YouTube: Magento Cloud Demo - Fastly functionality and VCL snippets with Nadiia Syvokonenko and Michael Casey
Description
In this demo, Nadiia and Michael will discuss best practices of configuring and usage of Fastly service on the Magento Cloud platform.
A
B
B
B
The
fastly
is
an
HTTP,
full
page
cache
service,
it's
based
on
varnish
software,
if
you've
ever
heard
of
that.
But
it's
very
much
enhanced
has
a
lot
more
features
and
even
the
VCL
has
enhancements.
It
functions
as
a
content
delivery
network,
so
you
get
accelerated
page
loads
close
to
at
with
points
of
presence
all
over
the
world,
so
they're
close
to
the
customers
and
they
get
lower
latency
and
faster
response
times
and
also
it
protects
your
origin
server
from
heavy
load
and
even
some
types
of
malicious
flows
like
like
denial,
service
and
so
on.
B
Fastly,
an
integral
part
of
Magento
cloud,
it's
bundled
with
Magento
cloud
pro
and
starter.
It's
a
core
part
of
the
Magento
cloud
offering.
So
we
really
would
never
recommend
someone
run
middle
class
without
fastly.
It's
part
of
it.
It's
is
part
of
what
makes
it
great
it's
bundled
and
tested
with
Magento
cloud.
So
you
know
it's
gonna
work
better
than
any
other
caching
service
and
we
also
work
with
the
fastly
team.
Whenever
we
identify
problems
or
whatever
we
have
questions
about
integration
with
additional
cloud
or
and
so
on.
B
Like
I
said
you
get
lower
latency,
because
the
customers
only
have
to
go
to
the
edge
cache
near
their
physical
location
instead
of
the
origin
server.
Whenever
you
get
a
cache
hit,
it
doesn't
add
any
load
to
your
site.
That's
why
I
mentioned
it
was
free
and
also
there's
edges.
Side
includes
so,
instead
of
having
to
invalidate
a
whole
page.
If
something
changed
on
the
page,
the
edge
caches
can
synthesize
that
page
out
of
smaller
components
and
most
of
those
components
can
be
cached.
B
So
you
have
availability
benefits
because
fastly
is
a
CDN.
It's
going
to
handle
a
lot
of
the
traffic
for
you,
depending
on
your
hit
rate,
so
that
includes
things
like
flash
sales
high
high
traffic
days
like
Black
Friday.
If
you
have
crawlers
that
are
trying
to
crawl
your
site
and
then
they
might
be,
you
know
the
rate
might
be
a
little
bit
too
high
or
whatever
we
see
misbehaving
crawlers
but
fascinates
protect
against
that
and
even
some
types
of
denial
of
service
attacks.
B
This
depend
if
they're
able
to
hit
pages
that
that
are
bypassing
the
cache.
Then
that
wouldn't
protect
you.
But
in
general
you
know,
most
of
the
pages
pages
on
your
site
are
going
to
be
served
by
fastly
edge
caches.
So
that
means
most
of
the
load
would
be,
would
be
absorbed
by
fastly
and
fastly
has
a
huge
network,
so
they
can
handle
basically
practically
unlimited
amount
of
volume.
B
You
get
your
credentials
whenever
you
prove
provision
to
your
Pro
or
starter
environment.
Usually
we
put
them
in
a
folder
for
NT,
shared
fastly,
underscore
tokens
txt,
and
there
you'll
find
your
service
ID
and
your
your
your
API
key.
B
B
The
other
way
to
specify
the
fasiq
credentials
is
with
project
level,
environment
variables
or
actually
use
with
environment
level
environment
variables.
Now
you
can
see
here,
though,
these
rather
long
strings
that
you
can
put
into
your
variable
section,
use
the
env
prefix
so
that
they
go
with
environment,
environment
variables
on
your
actual
Linux
environment,
and
then
you
have
config
default
system
which
is
all
pretty
standard
and
then
full
page
cache,
and
these
are
double
underscores
by
the
way
between
the
actual.
B
So
this
is
a
single
underscore
here,
no
full
page
cache
and
then
fastly
is
a
doubleheader
score.
That's
the
API
key
Fazli
service
ID,
and
so
this
way
you
can
specify
the
credentials
without
actually
having
to
put
them
in
your
canoeing
in
your
store
code.
So
that
can
be
that
can
be
advantageous
for
reasons.
I'll
cover
later.
B
B
One
of
the
biggest
things
to
get
good
performance
and
have
a
good
experience
is
to
make
sure
your
overall
cache
hit
rate
is
above
85%
weave
and
it
basically
any
site
with
a
cache
hit
rate
below
85%
could
improve
that
and
improving.
That
will
improve
your
overall
site
performance
as
I
mentioned
earlier.
It's
like
a
multiplier
effect.
The
higher
you
get
that
number,
the
better
your
site
can
perform
the
more
load
you
can
absorb.
So
basically,
anything
above
90%
is
good.
B
You
don't
have
to
worry
about
after
that,
and
you
can
use
the
fastly
API
to
check
your
cache
hit
rate.
There's
a
links
to
faster
docks
here
where
they
talk
about
this
API
request
more
in
detail,
but
basically
you
can
just
run
this
curl
request
and,
of
course,
you'd
replace
this
API
token.
With
the
credentials
I
showed
earlier
and
same
with
the
service
ID,
and
then
it
will
show
you
the
overall
cache
hit
rate
for
your
entire
service
or
your
entire
site.
Then
you
do
want
to
see
that
above
85%.
B
If
it's
full
five
percent,
usually
the
culprit
would
be
third-party
modules
because
in
general
them
the
Magento
code
out-of-the-box
allows
caching
as
it
should,
but
we
have
seen
third-party
modules.
A
lot
of
third-party
modules
are
very
well-behaved
and
work
great
with
fastly,
but
some
of
them,
maybe
weren't
designed
with
it
in
mind
or
maybe
they
just
you
know,
could
could
tweak
a
few
things
here
or
there.
So
just
for
custom
code,
you
can
troubleshoot
them
see
which
which
code
is
causing
the
problem,
maybe
contact
the
author
or
modify
them
to
where
they
allow.
B
B
You
can
troubleshoot
individual
pages
oftentimes
like
for
example.
The
cart
page
would
never
be
cached,
but
there
are
some
other
pages.
Maybe
it
should
be
cached
like
like
a
product
page,
and
so
you
can
test
individual
pages,
especially
your
home
page,
which
is
often
the
most
loaded
page
using
your
browser,
developer
tools
or
a
standalone
HTTP
clients
such
as
curl
you're,
going
to
look
at
the
response,
headers
and
you're.
B
Looking
for
the
X
cache
header
after
you
need
to
refresh
the
page
a
few
times,
because
if
you
are
loading
the
page
for
the
first
time,
it
could
just
be
that
it
wasn't
in
the
cache.
But
after
you
refresh
it
a
few
times,
it
should
have
had
a
chance
to
go
in
to
attach
at
that
point,
then
you
should
make
sure
that
the
header,
the
X
cache
header,
includes
the
word
hit
in
it
and
that
might
look
like
hit
hit,
hit,
miss
etc.
C
B
B
Another
great
thing
you
can
do
is
to
warm
up
warm
up
the
cache
after
a
deployment,
since,
if
you
do
a
deploy,
it
will
flush
the
cache,
which
is
understandable,
but
you
can
warm
up
those
pages.
It's
not
100%
necessary
because
you
know
the
first
request
will
fill
the
cache
up.
But
of
course
this
does
help
make
those
initial
requests
faster
for
customers.
B
Then,
finally,
what
the
best
practice
is:
it's
very
important
not
to
duplicate
Fazli
credentials
on
development
environments.
So
if
you
have
a
database
dump
of
your
production
environment
and
then
you
import
that
into
the
development,
you
want
to
make
sure
that
you
do
not
have
the
same
fast
leak,
rentals
on
your
developer
environment
and
that's
just
because
if
you
have
a
full,
if
you're
flushing
the
cache
in
your
development
environment,
you
only
want
it
to
flush
your
development
cache.
B
You
don't
want
to
flush
your
production
cache
and
if
you
have
the
fastly
API
credentials
in
your
development
environment,
then
it
can
send
those
API
requests
and
then
fastly
will
think.
That's
the
production
environment
asking
for
its
cache
to
be
flushed,
so
just
make
sure
if
you're
using
database
dumps
that
you
clean
them
or
if
you,
if
you
do
import
database,
dump,
make
sure
you
remove
those
credentials
as
soon
as
possible
from
your
development
environment.
And
you
can
also
use
those
environment,
environment
variables.
B
So,
in
summary,
you
want
to
verify
your
cap
overall.
Cache
hit
rate
is
about
85
percent.
You
can
troubleshoot
individual
pages.
If
you
think
a
page
is
not
loading
in
the
cache
or
if
you
want
to
troubleshoot
high
traffic
pages,
and
you
should
clean
database
dumps
to
make
sure
that
you
don't
import
your
production
credentials
into
development.
B
B
So
mass
redirects,
usually
the
use
case-
is
you
have
a
previous
platform
where
you
migrated
from
with
different
URLs
or
you're,
just
changing
your
URL
scheme.
So
maybe
you
did
an
upgrade
or
something
like
that,
and
you
want
to
make
sure
that
your
previous
search
engine
results
are
stay
intact,
that
you
don't
lose
those
search
engine
results.
So
you
want
to
do
a
redirect
or
a
rewrite,
whether
that
be
transparent,
rewrite
or
HTTP
300
redirect
303
xx.
B
Sometimes
people
want
to
use
fascinated
for
redirects
and
that's
understandable,
because
it's
pretty
phat
it's
very
fast
and
there's
no
cache
warm-up
associated
with
that,
since
the
configuration
is
on
the
edge
caches.
But
Magento
can
actually
be
the
right
way
to
do
this
in
many
cases,
because
there's
no
custom
VCL
required,
though
that
may
be,
because
less
troubleshooting
needed
less
less
things
that
can
go
wrong
there
and
also
with
vastly
there's
a
body
by
default,
a
limit
of
a
thousand
redirects
that
you
can
do
because
of
the
edge
dictionaries.
So
with
Magento.
B
So
this
is
the
Magento
URL
rewrite
import/export
module.
So
by
default
you
can
use
the
Magento
URL
rewrite
functionality,
but
it
doesn't
have
a
way
to
do
mass
imports
or
exports
without
having
to
do
like
manual
database
queries.
So
with
this
module,
which
we
provide
on
the
cloud
team
to
customers,
that
makes
sense
where
you
can
import
in
bulk,
then
you
can
find
more
information
here
on
dev
Doc's
at
the
bottom.
B
So,
as
I
mentioned,
we
have
seen
customers
use
100,000
rewrites
with
the
built-in
functionality
without
any
type
of
performance
problems.
The
rewrites
table
does
these
b-trees
in
the
database.
So
though
it
doesn't
necessarily
mean
that
you
know
twice
as
many
of
you
rights
just
don't
have
the
performance
right,
because
it's
indexed
and
also
misconception
is
that
with
fastly
rewrites,
it's
going
to
be
a
lot
faster
with
fastly
and
with
built-in
rewrites
it'll
be
slow.
B
B
B
You
would
go
down
to
custom
vcl
snippets,
then
you
create
a
custom
snippet,
and
then
you
make
a
snippet
sort
of
like
this.
So
here
the
name
can
be
anything,
but
the
type
should
be
receive.
The
priority
100
is
a
good
priority
and
then
here
there's
different
ways
to
do
this,
but
this
is
how
this
is
the
way
I
test
it
and
it
worked.
B
In
this
case
we
write
value,
a
is
just
a
custom,
temporary
variable
essentially,
and
so
I
just
do
a
table
that
look
up
on
the
rewrites
table,
which
I'll
show
you
I'll
make
later
and
we
take
the
URL
that's
being
requested
and
we
look
up
to
see
if
it's
in
the
the
table
three
writes
table.
If
it
is,
we
set
that
value
if
the
value
was
set,
meaning
it
was
found,
then
we
set
the
request
URL
to
instead
be
the
value
of
that
lookup.
B
So
we're
transparently
rewriting
the
URL
and
then
I
just
unset
the
temporary
variable
and
there's
also
ways
to
do
that
for
HTTP,
redirect
or
as
well,
then
I
showed
you
the
fact
we're
doing
a
table
lookup.
So
now
we
have
to
add
an
edge
dictionary,
which
is
the
table.
I
was
talking
about
and
you
can
see
if
key
value
pairs
and
then
you
would
just
put
the
source
and
destination
URLs
in
your
edge
dictionary.
B
There's
an
example
of
that
previous
configuration
redirect
test
and
this
just
loading
the
home
page.
This
one
looks
a
bit
different
than
the
other
home
page
because
on
this
one
I
had
sample
data
turned
on
on
the
other
one
I
didn't,
but
it's
the
same
thing
essentially
so,
as
I
showed
before
you
would
have
to
enter
those
items
one
by
one
and
also
they
are
limited
to
a
thousand
you're
still
limited
to
a
thousand
with
this.
But
you
can
at
least
add
them
in
bulk.
B
If
you
use
the
FAFSA
API-
and
this
is
similar
to
the
curl
request-
I
was
showing
earlier,
you
would
just
use
your
service
ID
and
your
API
token
that
you
get
with
your
store
and
then
you
can
do
a
request
like
this
and
add
them
in
bulk.
So
if
you
do
have
a
thousand
items,
you'd
probably
want
to
use
this
method,
so
you
didn't
have
to
click
so
much
on
the
admin
panel.
B
B
C
C
C
As
you
know,
every
object
which
is
cached
is
cached
for
some
period
of
time
and
it's
not
requested
from
the
server
again,
even
if
it
was
cached
on
in
our
case
of
magenta
side,
but
every
cache
can
be
invalidated.
It
and
fresh
content
will
be
requested
from
the
server
side
again,
and
there
are
two
types
of
cache
invalidation.
C
First
one
is
that
it
can
be
fired
to
the
first
place.
So
we
have
this
information
in
the
headers
like
expires.
This
header
has
expiration
date
and
time,
and
you
can
manage
this
age
in
magenta,
moonlight
or
FPC
for
education
configuration
like
you
see
on
the
screen.
It's
TTL
for
public
content
field.
By
default,
you
have
one
day,
TTL
and
sometimes
cache
should
be
clean
before
it's
expiration
and
it
can
be
done
by
cleaning
actions
as
manually
as
automatically.
C
C
C
So
these
are
those
entry
with
magenta
roulette
wheel,
attracts
and
it's
its
own,
like
folder
or
VAR,
ba
refresh,
if
your
firstly,
cash
is
configurated
and
used
pushing
this
button
won't
do
any
effect
on
it
when
the
second
one
flash
cash
storage
removes
all
items
from
the
cache
in
magenta
tags,
and
it
affects
also
all
their
applications
if
they're
using
and
of
course
it
if
you
use
fastly,
firstly,
HTML
cache
will
be
cleared
and
the
middle
grid.
You
see
all
cache
types
magenta
uses,
professor.
C
We
are
interested
in
full
page
cache,
so
this
type
of
cache
should
be
enabled
that
allow
us
to
manage
it.
Choosing
these
check
box
and
clicking
to
refresh
button
all.
Firstly,
HTML
cache
will
be
flushed
so
from
the
firstly
perspective
is
the
same
as
you:
click
on
flash
cache
storage
pod
can
be
considered
before
and
on
the
bottom
side
of
this
page,
you
may
see
a
six
buttons
in
production
ones.
There
are
things
buttons,
first
to
clear,
cache
for
Magento
site
for
generated
italic
images
and
emerged
copies
of
JavaScript
and
CSS
files.
C
C
Button
button
cleaning
facility
and
by
content
type
you
need
to
choose
one
of
four
types:
there
are
HTML
Javascript,
CSS
and
images,
choosing
any
of
the
type
and
click
in
the
button.
Firstly,
will
remove
cache
objects
by
content
type
and
actually
for
this
firstly,
uses
target
keys
which
allow
us
to
selectively
purge
related
content
for
it
and
in
this
screen,
I
show
you
the
example
how
you
can
check.
All
this
surrogate
keys,
I
use,
I
edited
had
had
her
tested
in
battle
1
and
for
HTML.
C
C
But
if
you
want
to
clean
just
cash
from
one
store,
you
need
to
use
next
button
clean
ethnicity
and
by
store.
It
also
do
their
cleaning
by
circuit
keys,
but
there
it
is
store,
keys
and
also
pay
attention.
With
its
removes
on
store
related
information,
it
doesn't
remove
ok
with
images
CSS
or
JavaScript,
and
the
third
button
I
mean
search
faster
bottom.
Quick
search
allows
you
to
clean
cash
for
certain
URL.
You
need
to
provide
URL
whole
URL,
including
domain
and
content,
for
this
page
will
be
the
last
one
page
all
actually
you
should
be.
C
You
need
to
be
careful
with
this
button,
because
it's
clear
or
absolutely
all
magenta,
cache
and
together
with
all
cash
fastly
has,
is
for
all
stores,
HTML
images,
CSS
and
so
on.
So
it's
like
a
whole
purging
and
why
I'm
asking
you
to
be
careful
with
it,
because
purging
too
much
fish
using
push
all
may
increase
your
website's
load
time
or
while
the
capital
e
rebuilding
I'm
certain
that
your
origin
and
handled
it
spike
in
traffic.
Otherwise,
you
may
notice,
but
increasing
all
by
all
three
errors.
C
C
Delete
all
items
by
the
types
don't
enabled
magenta
cache
types
actually
by
idea,
it
should
be,
are
the
same
as
we
had
all
previous
flash
magenta
cache
astly.
Also
clear,
HTML
cache
when
you
use
this
cash
lien
fund,
even
without
providing
an
attack
and
the
second
one
cache
flash
is
flashing,
a
fish
type
purchase.
C
C
C
C
Sometimes
you
may
notice
an
effect.
For
example,
if
you
change
something
like
in
this
example:
I
changed
category
name,
you
clean
the
cash
and
you
go
to
the
page
again
on
store
friend,
and
you
may
notice
that
you
have
the
same
the
same
content.
Nothing
was
changed
and
you
see
of
their
headers
heat,
always
what's
taken
from
cache.
But
if
you
are
along
the
page,
the
after
that,
you
will
receive
that
comes
updated
and
you
still
have
that
X
cache
miss
heat.
It
happened
because
I.
C
C
You
may
go
to
the
advanced
configuration
of
fastly
and
see
that
used
soft
purge
on
set
as
yes,
it's
in
default
value,
and
we
recommend
to
use
it
rather
with
this,
when
you
there
are
two
more
it's
a
stale
content
deliver
time
and
state
condom
delivery,
time
in
case
of
back-end
paper,
where
you
can
manage
the
time
when
this
stale
content
will
be
displayed
for
customers,
for
example
in
case
sort
of
an
error.
How
long
to
deliver
this?
C
C
There
is
additional
way
how
you
make
not
cleaning
care,
but
avoid
caching
of
some
of
your
pages.
You
need
to
create
your
custom
whistles
methods,
as
Mike
already
showed
these
ready
rates,
but
here
is
an
example
of
how
to
avoid
caching
for,
for
example,
category
in
my
case
its
category
one
two
and
pay
attention
on
the
priority,
because
if
we
want
to
to
have
this
condition
the
de
curler
beginning,
so
that's
why
you
need
to
stay
it
is
Haven
would
recommend
not
as
in
slide
like
five
or
something
like
this.
C
Elsewhere,
so
what
you
need
is
to
provide
incoming
that
hook,
you
around
by
default
festival,
a
module
will
send
you
information
about
publishing,
key
URL
purge
bands
purge
all
and
clean,
but
events
and
publish
config
changing
things.
But
sometimes
you
need
to
turn
showing
stack
trace
of
purge
all
events,
but
it
is
beautiful
if
you
are
experiencing
issues
due
to
frequent
purges
and
you
don't
know
what
were
the
cause
of
this.
C
Okay
and
a
additional
part
which
I
wanted
to
tell
you
today
it's
about
blocking
traffic,
and
you
know
that
sometimes
need
to
block
some
resources
of
your
web
application
for
country,
TPS
or
geographic
area,
and
you
can
do
it
too,
using
fastly
and
configure
blocking
from
the
magenta
green
UI.
You
also
can
use
this
feature
to
prevent
the
detectors
from
and
interpreting
your
web
application,
but
before
showing
you
how
to
block
some
ideas.
C
I
want
to
tell
you
about
a
CL,
so
H
ECL
is
a
access
control
list
that
allows
you
to
manage
AP
addresses
that
can
be
used
for
each
decision
like
a
lobbying
or
blocking
access
to
resources.
You
can
manage
existing
case
else
and
together,
like
creating
new
ones.
This
Allah
by
itself
has
two
parts
container
and
entries
within
each
tote.
Agree
that
NaCl
you
need
to
start
before
start
starting
using
it.
We
need
to
get
an
empties,
a
sealed
container.
C
First,
so
optically
keen
on
age,
parity
seal
new
pop-up
window
will
be
open
and
unity
provide
here.
Name
is
ill
container.
There
is
also
check
box,
which
you
may
use
to
activate.
You
can
turn
container
right
after
creation
and
by
default
it
is
checked
after
creation,
and
empty
container
will
appear
in
new
version,
though
present
current
moment,
we
use
the
version
25
after
creating
container
previous
founded,
the
Lord
and
plant,
a
new
one
will
be
activated
with
empty
ACL
list.
C
C
After
creating
creating
container,
you
need
to
add
entries
in
a
working
version
of
of
a
service,
as
you
remember,
we
already
attached
an
ACL
container
to
whistle
which
has
already
activated
the
data
data
in
the
container
becomes,
where
shameless.
So
all
these
new
ACL
entries
of
version
does
it
mean
that
any
further
changes
through
the
death
data
within
container,
such
as
addition
of
entries,
will
become
effective
immediately,
so
new
we
sell
version
only
create.
C
C
The
book
in
itself
so
firstly
allows
you
to
block
specific
IP
addresses
from
selling
your
service
by
adding
the
active
block
list.
This
featured
condition
and
responded
that,
with
returns,
four
or
five
error
to
anyone
trying
to
access
the
service
for
my
block,
addresses
dirt
with
three
main
fields
blocking
type
before,
for
example,
you
can
choose
a
block
block
list
or
a
lolis
along
the
existence,
bad
attitudes
if
variety
of
IPS
is
left
much
less
than
lovelyz.
C
C
You
need
to
save
config
in
much
interstate
conflict
and
then
click
a
button
enable
enable
block,
after
any
change
to
the
in
the
country,
list
or
SL
list,
you
need
to
click
update,
working
counting
its
for
changing
the
model
and
after
that,
if
you
vote
from
the
certain
MPs,
you
will
hit
that
you
will
see
about
five.
Four
or
five
error,
but
also
there
is
an
additional
way:
how
to
block
some
IPS
from
your
ACL
using
your
ACL,
pretty
separated
ACL,
it's
creating
custom
pass
snippet.