Azure CDN

A CDN is a service that can be used to scale your apps globally. It caches your static content, such as HTML pages, style sheets, images, documents, files, and client-side scripts on edge servers in different regions. This way, it will take less time to download them because the content is physically closer to the user, which increases the performance of your apps.

Azure CDN offers the following pricing tiers: Azure CDN Standard from MicrosoftAzure CDN Standard from AkamaiAzure CDN Standard from Verizon, and Azure CDN Premium from Verizon.

Azure CDN offers the following key features:

  • Dynamic site acceleration: Normally, CDNs have the ability to cache files closer to the end users to speed up the performance of loading the files. However, with dynamic web applications, the content is generated in response to the user behavior. Speeding up the loading process is more complex in these situations and requires a different solution, where each content element is fine-tuned along the full data path from inception to delivery. This feature is part of Azure CDN from Akamai and Azure CDN from Verizon
  • CDN caching rules: By using caching rules, the default cache expiration can be set or modified globally, and by using custom conditions, such as URL path and file extension. Azure CDN provides the following two different ways of controlling how files are cached:
    • Caching rules: The following global and custom caching rules are available:
      • Global caching rules: For each endpoint in your CDN profile, you can set one global caching rule. This will affect all requests that are made to that endpoint. If set, this global rule will override any HTTP cache-directive headers.
      • Custom caching rules: You can set one or more custom caching rules for each endpoint in your CDN profile. These rules match specific file extensions and paths, are processed in order, and override the global caching rule, if set.
    • Query string caching: How Azure CDN treats caching for requests with query strings can be adjusted as well. The query string caching setting has no effect if the file itself is not cacheable based on caching rules and CDN default behaviors. 
  • HTTPS custom domain support: If you are using the HTTPS protocol on your custom domain (for instance, https:az-103.com) for your apps (by installing an SSL certificate), a secure connection is made over TLS/SSL. Azure CDN supports HTTPS on a CDN endpoint host name by default. So, if you create a CDN endpoint (for instance, https://https:az-103.azureedge.net), HTTPS is enabled automatically. This feature is not available with Azure CDN Standard from Akamai products.
  • Azure diagnostics logs: You can view core analytics and save them to a variety of different sources. Azure diagnostics logs give you the ability to export the basic usage metrics from the CDN endpoints to an Azure storage account and then to a CSV, where you can create graphs in Excel to Azure Event Hubs and correlate data from other Azure services to Log Analytics workspace, and view data in there as well. This feature is available for all the pricing tiers.
  • File compression: File compression is an effective way to speed up the transferring of files and increasing the performance of the page load of your app. The file size is reduced before it is sent from the server. This can provide a more responsive experience for your app and can reduce the bandwidth costs. There are the following two options of file compression available:
    • Enable compression on the origin server: Azure CDN passes on the files that are already compressed at the server and delivers them to the client.
    • Enable compression on the CDN POP servers (compression on the fly): The CDN compresses the files itself and delivers them to the client.
  • Geo-filtering: With Azure CDN, you can restrict access to content by country. You can create rules on specific paths on your CDN endpoint to block or allow content in selected countries. This feature is not supported by Azure CDN Standard from Microsoft.
For comparing the features and capabilities of the different CDN products that are available for Azure, you can refer to the following article:  https://docs.microsoft.com/en-us/azure/cdn/cdn-features.

In the next section, we are going to configure Azure CDN endpoints.