Read all of the other posts in our series on Creating Azure (hosted) WordPress Websites without knowing php or MySql!

A Content Delivery Network (CDN) service is a network of geographically dispersed servers that have been optimized for distributing cached static files such as images, CSS/JS files and other web app structural components. Website users will receive your website’s cached static content from servers located nearest their geographic location, reducing page load time.

Overview of the Azure Content Delivery Network (CDN):

The Azure Content Delivery Network (CDN) caches static web content at strategically placed locations to provide maximum throughput for delivering content to users. The CDN offers developers a global solution for delivering high-bandwidth content by caching the content at physical nodes across the world.

The benefits of using the CDN to cache web site assets include:

  • Better performance and user experience for end users, especially when using applications like WordPress where multiple round-trips are required to load content.
  • Large scaling to better handle instantaneous high load.
  • By distributing user requests and serving content from edge servers, less traffic is sent to the origin.

Used in conjunction with a Caching Plugin, a CDN will considerably speed up the page loading time of a WordPress website which is also using a Theme like Divi, that has page-builder functionality – and lots of JS and CSS to load with each page request.

Configuring Azure CDN:

1. Create a new CDN Profile:

A CDN profile is a collection of CDN endpoints with pricing applied at the CDN profile level. Multiple endpoints for various Origin Types can be in the same CDN Profile.

Azure Portal > New > Web + Mobile > CDN > CDN Profile > select Create a new CDN endpoint now

Choose the Pricing Tier. We chose the S1 Standard Verizon for the ‘Custom domain HTTPS’ feature:

2. Create a new Endpoint

For the new CDN endpoint for a website, name the endpoint, for Origin type, select ‘Web App’ from the dropdown choices:

Select the Origin hostname – which is the WordPress website that the CDN will delivering the cached contents for – from the pre-populated list of websites within this Azure Subscription:

3. Add a Custom Domain

To add a Custom Domain to the new endpoint, navigate to the overview blade for the endpoint > Add Custom domain:

4. Migrate custom domains to CDN:

In the case of the existing website that a CDN is being added to, a custom domain name and an SSL certificate is already being used. The 3rd option outlined on the Migrate custom domains to CDN is followed:

On the DNS provider, add a DNS mapping for the current custom domain with cdnverify:

Note that while the custom domain has been added, the HTTPS is still Disabled

5. Enable HTTPS for Custom Domain

To enable the custom domain HTTPS feature – click directly on the Disabled text and a pop-up appears to turn the Custom domain HTTPS to On:

A series of 4 processes will begin:

  1. Submitting request

  1. Domain Validation:

This is a screen shot of the current email being sent for validation:

Responding to the link within the email:

  1. Certificate Provisioning: – this can take up to 6 hours to complete!

  1. Complete

For us, for private data access on websites such as internal wikis/knowledge-bases or support sites, it does not make sense to use a CDN – for cost or for exposing confidential data.

Nor do we use a CDN for websites with most of the content having a low hit rate, being accessed only a few times while it is valid (determined by its time-to-live setting). The first time an item is downloaded you incur two transaction charges from the origin server to the CDN and then from the CDN, to the customer.

On a public blog, using a caching plugin will give enough of a boost to the page load time to bring it under 2 sec. This provides less complexity and cost while still providing acceptable page load time.

Read all of the other posts in our series on Creating Azure (hosted) WordPress Websites without knowing php or MySql!