Offloading Static Resources to a CDN
Improving site speed has many factors, one of which involves using third party servers in delivering content, also known as a Content Delivery Network. My name is Rebekah and I’m an Enterprise Support Technician here at WP Engine and I'll be showing you how to help increase speed and scalability.
0:20s
A CDN works by serving your static content, such as your images, stylesheets, and javascript from a network of servers all over the world. When a visitor goes to your site, those static resources will load from the server that's geographically closer to them, which provides a shorter trip and therefor a faster load time. So let’s map this out to help drive home the point.
0:39s
Let’s say you have a visitor in New York city aaaaaaand one in Tokyo, Japan, with your web server located in Dallas TX. Without a CDN, every time a visitor goes to your website, the data needed to load your site travels from the visitor’s location to Dallas and back...You can see that this is A LOT of distance to travel to serve every aspect of your site. Additionally, all the information being processed is being done by your hosting server which increases its load and could lead to issues scaling. This, is where a CDN comes in to help out.
For our next scenario, your visitors and server are still in the same location. This time however, we have CDN servers in Hong Kong, Japan and Columbus, Ohio. With a CDN enabled, every time a visitor goes to your site they still pull information from Dallas, however, the server is only returning HTML. Once the HTML is delivered to the visitor, their BROWSER will make an additional request to the closest CDN server to pick up any static content like images, CSS, and Javascript. This lightens the load on your web server allowing faster load times and higher scalability. It should be noted that this is going to be of most benefit to sites that serve a wide, global audience, that rely on static content.
On the other hand, sites that predominately get visits from a local region, such as a local coffee shop, are not going to get much benefit from a CDN. This also applies to pages that require dynamic content to be generated on each page load -- think of purchasing a movie ticket online and selecting your seat -- this content needs to be dynamic in order to view up to the last minute seat selection.
2:13s
So you're probably asking "how can I get a CDN?". If you're already a WP Engine customer, we've made it very easy to set up. From your User Portal...go to your install and click the CDN link...Simply check the box for the domain on which you'd like to enable the CDN...and save the change. Our system needs up to 10 minutes to fully activate the CDN. If you're not a WP Engine customer, you can find CDN providers such as MaxCDN that can help enable it on your site.
2:41s
To see if it's working, right click on one of your pages and view the source code...Your static content, like your images, will now be using a new CDN URL, which will have random letters appended to it.
There are tools that you can use to see how the site performs from different locations, which we've covered in our second video in this Speed Series, called Measuring Site Speed.
Continuing on with this topic of offloading requests, be sure to check out our next video on Reducing Server Requests within our WP Engine Speed Series. Thanks for watching!
A CDN could be used to speed things up and offload static resources from your primary server and bring your content to the global scale.
In this video we will explore how to incorporate a CDN into your site and how to configure it so that you can speed up the user experience of your site at a global scale.