Content Delivery Network or Content Distribution Network (CDN) is a globally distributed network of proxy servers, deployed in multiple data centers, which serve content to end users with high availability and high performance.
Usually, when a user visits your site, he/she gets redirected to your web host’s server, which is found at a central location. Based on the distance between the user’s and the server’s location, response times may vary and may result in slowing load times for your visitor. In addition, when traffic in your site increases, your server may overload and that may result in slow performance.
Azure provides a Content Delivery Network Service that helps you optimize your app’s performance globally, by delivering your content through multiple provider solutions, like Akamai and Verizon.
Let’s start by creating a CDN service, and then we will use it in our WordPress site to serve static and cached content through Azure.
1. Create a new Service
2. Create an endpoint
Endpoints allow you to configure content delivery behavior and access by specifying the Name, Origin Type, Origin Hostname, and Host Header which specifies the origin hostname address that is associated with the request.
After a few seconds your endpoint is ready for use.
Configure your WordPress site to use Azure’s CDN service
In order to do so, you can use a plugin that makes it really easy, WP Super Cache.
After installing it, from your WordPress Admin Dashboard, you:
- select “Settings => Wp Super Cache Settings”,
- from CDN Tab, specify Off-site URL as your endpoint’s name, which in that case is “ppolcdn.azureedge.net”,
- leave everything else on default, and
- from Easy Tab, set Caching On
Test your site
Reload your site and from Chrome Developer Tools Network tab you can see that all static content now loads from Azure’s CDN service.
Azure provides basic analytics, such as bandwidth, hits, cache hit ratio, etc. that can help you understand usage patterns.
Service pricing in Azure changes constantly, so you better head up here for more info.