SPEAKER: Welcome to Google Cloud Drawing Board, where we doodle
our way through the Cloud.
Today's topic-- What is Cloud CDN?
This video is divided into chapters.
Watch the full video or skip ahead
to a new section of your choice.
Whatever your app or website is, chances
are that your users are distributed
across different locations and are not
necessarily close to where your servers are.
This means the requests travel across the public internet
through long distances, leading to inconsistent and frustrating
user experiences.
That's where Cloud CDN comes in.
Cloud CDN is a content delivery network
that accelerates your web and video content
delivery by using Google's Global Edge
Network to bring content as close to the user as possible.
As a result, the latency, cost, and load
on your backend servers is reduced, making it easier
to scale to millions of users.
Let's consider an app to understand how this works.
When a user makes a request to your website or app,
the request is routed to the closest Google Edge Node.
We have all 120 of these for fast and reliable traffic flow.
Then, to the global HTTP(S) load balancer,
to the backend, or the origin.
From there, with Cloud CDN enabled,
we'll serve the content directly from cache.
Cache is nothing but a group of servers that store and manage
cacheable content so that future requests for that content
can be solved faster.
The cached content is a copy of cachable content
that is stored on your origin servers,
typically including web assets like JavaScript, CSS, images,
and videos.
Cloud CDN can automatically cache this content
with just a single checkbox, using the recommended cache
modes to cache all static content.
If you need more control, you can direct Cloud seeding CDN
by setting HTTP headers on your responses.
And you can also force all content to be cached.
Just know that this ignores the private, no-store,
or no-cache directives in cache control response headers.
When the request is received by Cloud CDN,
it looks for the cached content using the cache key, which
is typically the URI.
But you can customize this cache key
to remove protocol posts or query strings.
For the user's request, if a cached response
is found in Cloud CDN cache, the response
is retrieved from cache and sent to the user.
This is called a cache hit.
When a cache hit occurs, Cloud CDN
looks at the content byte's cache key
and responds directly to the user,
shortening the round trip time and saving the origin server
from having to process the request.
The first time that a piece of content is requested,
the Cloud CDN can't fulfill the request from the cache
because it doesn't have it there.
This is called a cache miss.
When a cache miss occurs, the Cloud CDN
might attempt to get the content from the nearby cache.
If the nearby cache has the content,
it sends it to the first cache by using cache-to-cache fill.
Otherwise, it just sends the request
through the origin server.
The maximum lifetime of the object in cache
is defined by the TTLs, or time to live values,
set by the cache directives from each a HTTP response,
or cache modes.
When the TTL has expired, the content is evicted from catch.
Now, how do you use Cloud CDN?
You can set up Cloud CBN through GCloud Command Line interface,
Could Consol, or the APIs.
Since Cloud CBN leverages Google Cloud global external HTTP(S)
load balancers to provide routing, health
checking, and Anycast support, it
can be enabled by easily checking a box while setting up
the backends or the origins.
Cloud CDN makes it even easier to solve web and media content
using Google Cloud Storage.
You just upload your content to a bucket, set up load balancer,
and enable caching.
And if you are like many of our customers, ,
you probably have services that are on-prem or in other clouds.
To enable these hybrid architectures,
Cloud CDN and HTTP(S) load balancing
also support external backends.
Let's get into the underlying details now.
Global Anycast IPs provide single IP for global reach.
It allows Google Cloud to round users to the nearest edge
cache automatically and avoid relying on the DNS propagation
delays that can impact availability.
It also supports HTTP end-to-end and quick protocol from cache
to cache.
QUIC is a multiplex-to-stream transport
over UDP, which reduces latency, making
it ideal for lossy mobile networks.
That brings me to security.
Data is encrypted at rest and in transit from Google Cloud load
balancing to backend, supporting an end-to-end encrypted
experience.
You can programmatically sign URLs and cookies
to limit video segment access to all authorized users only.
The signature is validated at the CDN Edge
and the request that should not get through
is blocked right there.
On a broader level, you can enable SSL
for free using Google managed certs.
Now, to summarize, use Cloud CDN to improve performance
and reduce serving costs for regularly accessed
content by automatically caching static content
with a click of a button.
Want to learn more about Cloud CDN?
Check out cloud.google.com/cdn.