/ Azure

Azure CDN for Sitecore

What is CDN?


In simple words the website and assets are cached in multiple servers across the world. When a user visits the site they are served from the nearest server to their location to reduce latency and improve load times.


Image Source

Why to use CDN?

The CDN helps in reducing the latency and download time. Since CDN will be a different domain, Help in concurrent download of assets.Improves page load time that gives a better User Experience. Having a better position in search engines. The number of website visitors who turn to customers.

  • Improve page load speed
  • Handle high traffic loads
  • DDos attack prevention
  • Reduce bandwidth consumption
  • Higher conversion rates
  • Scalability

Every Second Counts
Studies show that a second-long delay causes a 7% drop in conversions, an 11% drop in page views and a 16% drop in customer satisfaction.

Types of Azure CDN

I am mainly focusing on the CDN offerings on Azure. The following offerings are provided in Azure as endpoints.

CDN Marketplace offering


The pricing is inexpensive compared to the value and speed that is provided by the Azure CDN.


Azure Content Delivery Network (CDN) includes four products:


Limits to 25 CDN Profiles per Subscription. Limit 25 Endpoint per profile. Limit 25 Domains per endpoint.

How to enable CDN with Sitecore?

The CDN works for public facing websites. The CDN needs to access and replicate the CD server. We can use CDN in two ways for Sitecore right out of the box

  1. Media library items
  2. Static assets

Media Library items

On the Sitecore Content Delivery (CD) server, go to the Sitecore deployment folder.

  • In App_Config\Include, create a folder named CDN.
  • In the CDN folder, create a file and name it: CDN.config
  • Edit the CDN.config file and save the following information to the file:



How to setup Azure CDN?

Create a new resource by searching for CDN

Compare the offerings screen choose Explore other offerings and Azure CDN Standard from Microsoft

Common Error if you have not registered the CDN Resource provider in your subscription

Follow the instructions in the article and enable Microsoft.Cdn, it will take few minutes before you can use it.


Provide the information in the CDN profile creation page

Validation is passed review and create

Site will not be immediately available but will take some time depending on the size of the site.

Important Settings

First things to-do once created is to update caching rules by default its set to ignore the query strings. It needs to be updated to cache every unique URL that will help in reflecting the changes of media items when they are published.

Example URL of an image from Sitecore media library would be like the following
Its really important to enable that settings.


When the images or assets publised the revision guid in the Url should pull the new asset. If in case if you need to purge the CDN to force reload. Follow the purge option that could be done at the site level or a path.

Bonus Tip
The CDN can be setup with a custom domain and domain certificate will be provisioned without any additional cost for free by Microsoft.

WEBP support

If you have installed Dianoga it will support nextgen format webp. Azure CDN (Microsoft) Classic doesnt support it and Nehem has a solution for it in this article - https://www.nehemiahj.com/2022/08/sitecore-dianoga-with-azure-cdn.html