{"id":82812,"date":"2020-10-06T11:00:47","date_gmt":"2020-10-06T08:00:47","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/a-cdn-can-speed-up-your-website-heres-what-you-need-to-know-cloudsavvy-it\/"},"modified":"2020-10-06T11:00:47","modified_gmt":"2020-10-06T08:00:47","slug":"a-cdn-can-speed-up-your-website-heres-what-you-need-to-know-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/a-cdn-can-speed-up-your-website-heres-what-you-need-to-know-cloudsavvy-it\/","title":{"rendered":"#A CDN Can Speed Up Your Website. Here\u2019s What You Need to Know! \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a3dbde5ecbe4\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" 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: #dd3333;color:#dd3333\" 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><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a3dbde5ecbe4\" checked aria-label=\"Toggle\" \/><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:\/\/buradabiliyorum.com\/en\/a-cdn-can-speed-up-your-website-heres-what-you-need-to-know-cloudsavvy-it\/#How_Do_CDNs_Work\" >How Do CDNs Work?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/a-cdn-can-speed-up-your-website-heres-what-you-need-to-know-cloudsavvy-it\/#Full-Site_Caching\" >Full-Site Caching<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/a-cdn-can-speed-up-your-website-heres-what-you-need-to-know-cloudsavvy-it\/#Should_You_Use_a_CDN\" >Should You Use a CDN?<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#A CDN Can Speed Up Your Website. Here\u2019s What You Need to Know! \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-794 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/2f4a6c0c6ebd9c856345c1bdcc083835\/p\/uploads\/2019\/06\/be8df346.png\" alt=\"CloudFlare logo.\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>A Content Delivery Network (CDN) is designed to reduce the load on your primary web servers by caching your static assets on a network of servers. These servers will be closer to users, which can speed up your load times.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"How_Do_CDNs_Work\"><\/span>How Do CDNs Work?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Without a CDN, a user would make a request to your web server, which would send over the corresponding HTML, images, Java<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">Script<\/a> files, and any other assets your site needs. The server may also query a database to request content, as is the case with content management systems like WordPress. All of this puts a lot of strain on your web server for a single request.<\/p>\n<p>A CDN doesn\u2019t replace your web server; it sits in between the user and the web server, and caches your site\u2019s content. Each CDN endpoint is called a point of presence (PoP), and most CDN providers will have hundreds of them spread across the globe. Having a PoP physically close to the end user reduces latency, referred to as the \u201cnetwork edge.\u201d CDNs try to optimize the amount of time users spend on the network edge without having to make a request further into the network (and bug your web server).<\/p>\n<p>This kind of CDN is called an \u201corigin pull\u201d or \u201cmirror\u201d CDN. A pull CDN mirrors the content on your website and delivers it with lower latency and improved caching. The other variant is called a \u201corigin push\u201d CDN, which can replace some parts of your web server. Push CDNs are primarily used to host content that would be infeasible to host on traditional web servers like video streaming services or other large <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/social-mediaa\/\" data-internallinksmanager029f6b8e52c=\"1\" title=\"Social Media\" target=\"_blank\" rel=\"noopener\">media<\/a>. For example, images and videos stored in <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/aws.amazon.com\/s3\/?tag=reviewgeek-20\">Amazon S3<\/a> can be served through their <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/aws.amazon.com\/cloudfront\/?tag=reviewgeek-20\">CloudFront<\/a> CDN in a push configuration, eliminating the need to host that content altogether.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Full-Site_Caching\"><\/span>Full-Site Caching<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Many CDNs are used primarily to cache images, files, and other static content. But some CDNs, particularly <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/www.cloudflare.com\/\">Cloudflare<\/a>, <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/www.fastly.com\/\">Fastly<\/a>, and <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/aws.amazon.com\/cloudfront\/?tag=reviewgeek-20\">Amazon CloudFront<\/a>, can cache your entire site. Full-site caching can be configured to expire in just a few seconds, which keeps your site responsive while taking a lot of load off your web servers.<\/p>\n<p>You can set up rules for each type of page you have, and choose how long you want the content to be cached. This can either be done through the admin panel with your CDN provider, or by adding <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/docs.fastly.com\/guides\/basic-concepts\/how-caching-and-cdns-work#cache-control\"><code>Cache-Control<\/code><\/a> headers to your HTTP responses, with which you can set <code>max-age<\/code>\u00a0to a specific time in seconds.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"imgchk9 alignnone wp-image-791 size-full\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/fcf422dd0382b5605ebffad20da37284\/p\/uploads\/2019\/06\/e73c0bad.png\" alt=\"Setting up caching rules.\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>However, you shouldn\u2019t apply these settings blanketly to your entire site. Some things\u00a0need to be dynamic. For example, a user\u2019s profile page, or any page requiring authentication, should\u00a0<em>never<\/em> be cached, or else everyone visiting their own profile page would find themselves viewing the information of another account. This is exactly what happened to<a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/www.wired.co.uk\/article\/valve-explains-christmas-steam-attacks\"> Steam during their 2015 Christmas sale<\/a>, when Valve updated their caching configuration to attempt to mitigate a traffic spike, and inadvertently cached user data. This didn\u2019t let anyone log in as another user, but it let them view a copy of their private data, which is still a huge security breach.<\/p>\n<p>In some cases, APIs can be cached. A site like Reddit, for example, doesn\u2019t need to make a database request every time someone requests the top posts on the home page. You could instead cache them every minute or so, and only make requests when necessary, like someone requesting new posts. However, some APIs may break with caching, so you\u2019ll need to do testing on your end to see if it will work for yours.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Should_You_Use_a_CDN\"><\/span>Should You Use a CDN?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If your website receives any amount of traffic, you should definitely cache your static assets, such as images, CSS stylesheets, and JavaScript files, even if you don\u2019t have issues with traffic. CDNs can speed up your site regardless, simply because they are located much closer to users. Whenever your site has to do a handshake, there\u2019s much less distance round <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/trip-and-travel\/\" data-internallinksmanager029f6b8e52c=\"10\" title=\"Trip &amp; Travel\" target=\"_blank\" rel=\"noopener\">trip<\/a>.<\/p>\n<p>If your site meets a lot of traffic, full-site caching (or at least, on the main pages of your site) can take a lot of load off your web servers.<\/p>\n<p>If you\u2019re using a specialized hosting provider, such as SquareSpace, Shopify, or WordPress, that provider probably already has their own CDN built in, and will usually handle the details of hosting your website for you.<\/p>\n<p>You should also make use of the browser cache, which you <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"http:\/\/radar.oreilly.com\/2015\/04\/how-to-leverage-the-browser-cache-with-a-cdn.html\">can use alongside a CDN<\/a>. Essentially, your assets will be stored in the user\u2019s browser for a short time (5-10 minutes), so that if they click on another page of your site, their browser won\u2019t even have to make a request for the content it already has. But if you made changes to the site, and they came back the next day, they would be served an updated page from the CDN because the browser cache has expired.<\/p>\n<p>Even if you\u2019re not using for a CDN for your website, you should source popular JavaScript libraries like jQuery from a widely used CDN. This will mean your web server doesn\u2019t have to serve that file itself if the user has recently been to a site using the same CDN and library.\n<\/p><\/div>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener noreferrer\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/784\/a-cdn-can-speed-up-your-website-heres-what-you-need-to-know\/\" target=\"_blank\" rel=\"noopener noreferrer\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#A CDN Can Speed Up Your Website. Here\u2019s What You Need to Know! \u2013 CloudSavvy IT&#8221; A Content Delivery Network (CDN) is designed to reduce the load on your primary web servers by caching your static assets on a network of servers. These servers will be closer to users, which can speed up your load&#8230;<\/p>\n","protected":false},"author":1,"featured_media":82813,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/06\/be8df346.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-82812","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/82812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=82812"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/82812\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/82813"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=82812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=82812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=82812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}