Azure CDN Logo Azure

Azure CDN on WordPress

Content Delivery Network (CDN) let you distribute static content from your website or other web application from locations closest to the end-user. For a standard web site this include things like images, CSS files, Java script and so on.

 

Looking at the image below, you can see that visitors on this site is scattered around. enabling CDN will therefore improve performance by delivering the content from different locations rather than the site host which is in Europe.
Following this post you should be able to have CDN up and running in about 15 minutes 🙂

 

visitors location

 

 

 

 

PreReq’s

  • W3 Total Cache WordPress Plugin
  • Azure Subscription

 

Enable Azure CDN

The first thing you need to do is to create a new Azure CDN profile in the Azure portal. Search for CDN and create a new profile.

I chose to go with the standard Verizon version which at this point it cost $0.08 per GB up to 10TB usage. If you have other needs please check the features and pricing for Azure CDN here.

Next, create a new endpoint and configure the origin. If you run your site in Azure you can find it in the drop down. The endpoint will be the URL which all cached content is available. You can run multiple endpoints under one profile, i just ended up using a 1-1 resource group, profile and endpoint.

Azure CDN endpoint blade

According to Azure documentation, it can take up to 90 minutes before new endpoints are cached, so expect to see 404 errors after you have created it. Take a note of the endpoint hostname which is the address we are configuring in WordPress.

 

Configure WordPress CDN

Heading over to your wordpress admin page you will have to enable CDN under W3 Total Cache general settings. Tick enable and chose generic mirror as your CDN type. Azure CDN will mirror your data and using “pull” functionality.

Enable CDN using wordpress

 

 

After this is enabled click CDN under performance on your left menu. If you do not remember your endpoint name, go back and copy it from the Azure portal.

 

Scroll down to the configuration area and put in your endpoint name without HTTP(s). Check connectivity by clicking “test mirror”

 

This is all configuration needed to do basic CDN using Azure on your WordPress web site, but a lot of customization can be done both in Azure and in WP. After caching is enabled and time has done it things. You should be able to confirm that mirroring is working. Here is a screenshot of Chrome developer tools where you see the image URL is my CDN endpoint in Azure.

 

6 COMMENTS
  • бнанс створення акаунту
    Reply

    Your article helped me a lot, is there any more related content? Thanks!

  • Vibin
    Reply

    Hi Martin Ehrnst!Your explanation about “Azure CDN on WordPress” is obvious. In this blog, your description of configuring WordPress CDN was beneficial to know this and was straightforward to enable CDN and configure WordPress. Your attached images are self-explanatory to find. Thank you for sharing your knowledge!

  • Katie
    Reply

    Hello, I settup wordpress on azure. I am not sure how this will work. May I run into some issues with WordPress websites on azure especially with new plugins? It can be a problem that some of them will not work on azure?
    Thank you

    1. Martin Ehrnst
      Reply

      Hi Katie. I cannot answer that specifically, but I used several extensions on azure without problems

  • nik
    Reply

    hi,
    what if i don’t run website in Azure, what’s the second step?
    thanks

    1. Martin Ehrnst
      Reply

      Hi Nik, you should be able to manually enter your hostname / orgin.

Engage by commenting