How Google Cloud CDN Work?
So, let’s consider an app to understand how this works.
A user’s request for your website or app is forwarded to the nearby Google Edge Node. For dependable and quick traffic flow, GCP has 120 of these. After that, the backend, origin, or the global HTTP(S) load balancer. We will then deliver the material directly from the cache after turning on Cloud CDN.
The cache is nothing more than a collection of servers that handle and store content that can be cached in order to respond more quickly to future requests for that content. The cached content, which commonly consists of web assets like JavaScript, CSS, pictures, and videos, is a duplicate of the cachable content that is kept on your origin servers.
With the click of a single checkbox, Cloud CDN may automatically cache this material using the suggested cache modes for all static content. By configuring HTTP headers on your answers, you can direct Cloud seeding CDN if you require additional control. Also, you can make sure that all content is cached. Just be aware that the private, no-store, and no-cache directives in the cache control response headers are disregarded by this. When Cloud CDN receives a request, it uses the cache key—typically the URI—to find the content that has already been cached. However, this cache key can be modified to eliminate protocol posts or query strings.
If a cached response to the user’s request is discovered in the Cloud CDN cache, the response is retrieved and provided to the user. It’s known as a cache hit. Shortening the round trip time and avoiding the origin server needing to handle the request when a cache hit happens, Cloud CDN examines the content byte’s cache key and responds directly to the user.
The Cloud CDN cannot satisfy the initial request for a piece of material from the cache since it does not yet have it. It’s known as a cache miss. The Cloud CDN could try to get the material from the close-by cache when a cache miss occurs. The content is sent to the first cache using cache-to-cache fill if the nearby cache contains it. If not, the request is simply routed through the origin server.
The TTLs, or time to live values, set by the cache directives from each HTTP response, or cache mode, determine the maximum lifespan of the object in cache. Content is removed from catch once the TTL has passed.
What is Google Cloud CDN?
Cloud CDN will cache the content at edge locations that are located around the world. By doing so, we can reduce the latency, which improves the performance of our applications. It will enable users to access the content from nearby edge locations, regardless of the app or website you have, there’s a reasonable probability that your users are dispersed across the globe and aren’t necessarily local to your servers.
This implies that the requests go over a wide area of the public internet, resulting in unpredictable and annoying user experiences. In this situation, Cloud CDN is useful.