{"id":8362,"date":"2021-12-21T16:10:36","date_gmt":"2021-12-21T09:10:36","guid":{"rendered":"https:\/\/gcloudvn.com\/?p=8362"},"modified":"2023-09-13T16:01:17","modified_gmt":"2023-09-13T09:01:17","slug":"cloud-cdn-la-gi-va-no-hoat-dong-nhu-the-nao","status":"publish","type":"post","link":"https:\/\/gcloudvn.com\/en\/kienthuc\/cloud-cdn-la-gi-va-no-hoat-dong-nhu-the-nao\/","title":{"rendered":"What is a Cloud CDN and how does it work?"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Regardless of what your app or website does, chances are your users are distributed in a variety of locations and not necessarily near your server. This means that requests travel long distances through the public internet, resulting in an inconsistent and sometimes frustrating user experience. That&#039;s where <\/span><span style=\"font-weight: 400;\">Cloud CDN<\/span><span style=\"font-weight: 400;\"> appear!<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-8363\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2021\/12\/Cloud_CDN_Sketchnote.max-2000x2000-1-300x169.png\" alt=\"What is a Cloud CDN and how does it work?\" width=\"600\" height=\"338\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2021\/12\/Cloud_CDN_Sketchnote.max-2000x2000-1-300x169.png 300w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2021\/12\/Cloud_CDN_Sketchnote.max-2000x2000-1-1024x576.png 1024w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2021\/12\/Cloud_CDN_Sketchnote.max-2000x2000-1-768x432.png 768w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2021\/12\/Cloud_CDN_Sketchnote.max-2000x2000-1-1536x864.png 1536w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2021\/12\/Cloud_CDN_Sketchnote.max-2000x2000-1-18x10.png 18w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2021\/12\/Cloud_CDN_Sketchnote.max-2000x2000-1.png 2000w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/cloud-cdn-la-gi-va-no-hoat-dong-nhu-the-nao\/#Cloud_CDN_la_gi\" >What is Cloud CDN?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/cloud-cdn-la-gi-va-no-hoat-dong-nhu-the-nao\/#Cloud_CDN_hoat_dong_nhu_the_nao\" >How does Cloud CDN work?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/cloud-cdn-la-gi-va-no-hoat-dong-nhu-the-nao\/#Cach_su_dung_Cloud_CDN\" >How to use Cloud CDN\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/cloud-cdn-la-gi-va-no-hoat-dong-nhu-the-nao\/#Bao_mat\" >Security<\/a><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Cloud_CDN_la_gi\"><\/span><strong>What is Cloud CDN?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\"><strong>Cloud CDN<\/strong> is a content delivery network that accelerates the delivery of your web and video content by using Google&#039;s global edge network to bring content as close to users as possible. As a result, latency, costs, and load on your backend servers are reduced, making it easier to scale to millions of users. Global anycast IP provides a single IP for global reach. It allows <a href=\"https:\/\/gcloudvn.com\/en\/google-cloud-platform\/\">Google Cloud<\/a> automatically routes users to the nearest edge cache and avoids DNS propagation delays that can impact availability. It supports end-to-end HTTP\/2 and the client-to-cache QUIC protocol. QUIC is a method of transporting multiplexed streams over UDP, which reduces latency and is ideal for lossy mobile networks.<\/span><\/p>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Cloud_CDN_hoat_dong_nhu_the_nao\"><\/span><strong>How does Cloud CDN work?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Let&#039;s look at an example to understand how Cloud CDN works:<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">When a user makes a request for your website or app, the request is routed to <\/span><a href=\"https:\/\/cloud.google.com\/cdn\/docs\/locations\" rel=\"nofollow noopener\" target=\"_blank\"><span style=\"font-weight: 400;\">Google edge node<\/span><\/a><span style=\"font-weight: 400;\"> closest (we have over 120 of these) for fast and reliable traffic flow. From there, the request is routed to the Global HTTPS Load Balancer to the backend or origin.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">With Cloud CDN enabled, content is served directly from cache \u2013 a group of servers that store and manage the cacheable content so future requests for that content can be served faster.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Cached content is a cacheable copy of web content (JavaScript, CSS), images, videos, and other content stored on your origin server.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Cloud CDN automatically caches this content when you use the recommended \u201ccache mode\u201d to cache all static content. If you need more control, you can direct the Cloud CDN by setting an HTTP header on your response. You can also force all content to be cached; just know that this ignores the \u201cprivate\u201d (private), \u201cno-store\u201d or \u201cno-cache\u201d (no cache) directives in the Cache response header- Controls.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">When the Cloud CDN receives the request, it searches the cached content using <\/span><a href=\"https:\/\/cloud.google.com\/cdn\/docs\/using-cache-keys\" rel=\"nofollow noopener\" target=\"_blank\"><span style=\"font-weight: 400;\">cache key<\/span><\/a><span style=\"font-weight: 400;\">. This is usually a URI, but you can customize the cache key to clear the protocol, server, or query string.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul style=\"text-align: justify;\">\n<li aria-level=\"1\"><span style=\"font-weight: 400;\">If a cached response is found in the Cloud CDN cache, the response is retrieved from the cache and sent to the user. This is called a cache hit. When a cache hit occurs, Cloud CDN searches for the content with its cache key and responds directly to the user, shortening round-trip times and reducing load on the origin server.<\/span><\/li>\n<\/ul>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A piece of content is requested the first time, Cloud CDN cannot make the request from the cache because it does not have that piece of content in the cache. This is called a cache error. When a cache failure occurs, the Cloud CDN may try to get content from a nearby cache. If a nearby buffer has content, it sends that content to the first buffer using fill-from-buffer. Otherwise it just sends the request to the origin server.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The maximum lifetime of objects in the cache is determined by TTLs, or lifetime values, set by the cache directive for each HTTP response or cache mode. When the TTL expires, the content is removed from the cache.<\/span><\/li>\n<\/ul>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Cach_su_dung_Cloud_CDN\"><\/span><strong>How to use Cloud CDN\u00a0<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">You can set up Cloud CDN through gCloud CLI, Cloud Console or API. Because Cloud CDN uses <\/span><span style=\"font-weight: 400;\">Cloud Load Balancing<\/span><span style=\"font-weight: 400;\"> to provide routing support, health checking and anycast IP, it can be enabled by selecting a checkbox easily while setting up your backend or origin.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Cloud CDN makes it easy to serve web and media content using Google Cloud Storage. You simply upload your assets to your Cloud Storage bucket, set up your Load Balancer, and enable caching. To enable hybrid architectures that span the clouds and on-premises, Cloud CDN and HTTP(S) Load Balancing also support external backends.<\/span><\/p>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Bao_mat\"><\/span><strong>Security<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Data is encrypted at rest and passed from Cloud Load Balancing to the backend for end-to-end encryption.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You can programmatically sign URLs and cookies to limit video segment access to authorized users. The signature is validated at the CDN edge and unauthorized requests are blocked right there!\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">On a broader level, you can enable free SSL using a certificate managed by Google!\u00a0<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">For an in-depth look at Cloud CDN, check out<\/span> <a href=\"https:\/\/cloud.google.com\/cdn\" rel=\"nofollow noopener\" target=\"_blank\"><span style=\"font-weight: 400;\">document<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p style=\"text-align: right;\"><strong>Source: Gimasys<\/strong><\/p>","protected":false},"excerpt":{"rendered":"<p>B\u1ea5t k\u1ec3 \u1ee9ng d\u1ee5ng ho\u1eb7c trang web c\u1ee7a b\u1ea1n l\u00e0m g\u00ec, r\u1ea5t c\u00f3 th\u1ec3 ng\u01b0\u1eddi d\u00f9ng c\u1ee7a b\u1ea1n \u0111\u01b0\u1ee3c ph\u00e2n ph\u1ed1i \u1edf nhi\u1ec1u v\u1ecb tr\u00ed kh\u00e1c nhau v\u00e0 kh\u00f4ng nh\u1ea5t thi\u1ebft ph\u1ea3i \u1edf g\u1ea7n m\u00e1y ch\u1ee7 c\u1ee7a b\u1ea1n. \u0110i\u1ec1u n\u00e0y&hellip;<\/p>","protected":false},"author":2,"featured_media":8363,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1,135],"tags":[],"class_list":["post-8362","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kienthuc","category-google-cloud-platform","entry","has-media"],"_links":{"self":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts\/8362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/comments?post=8362"}],"version-history":[{"count":0,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts\/8362\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/media\/8363"}],"wp:attachment":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/media?parent=8362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/categories?post=8362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/tags?post=8362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}