Azure CDN Overview:
The Microsoft Azure CDN (Content Delivery Network) offers a global solution for delivering high-bandwidth content that is hosted in Azure or any other location. Using the CDN you can cache publicly available objects loaded from Azure blob storage, a web application, virtual machine, application folder or any other HTTP/HTTPS location. The CDN cache can be held at strategic locations to provide maximum bandwidth for delivering content to users. The CDN is typically used for delivering static content such as images, documents, files, scripts and static pages like HTML.
This can be set up with very simple steps:
1. Add a custom domain to your Azure CDN endpoint:
When you use a CDN endpoint to deliver content, a custom domain is necessary if you would like your own domain name to be visible in your CDN URL. Having a visible domain name can be convenient for your customers and useful for branding purposes.
You need to follow the below steps:
- Create a CNAME DNS record.
- Associate the custom domain with your CDN endpoint.
- Verify the custom domain.
2. Configure HTTPS on a custom domain:
Enabling the HTTPS protocol for a custom domain that is associated with an Azure CDN endpoint. By using the HTTPS protocol on your custom domain you ensure that your sensitive data is delivered securely via TLS/SSL encryption when it is sent across the internet.
Consider this process:
- Enable the HTTPS protocol on your custom domain.
- Use a CDN-managed certificate or Use your own certificate
- Validate the domain
- Disable the HTTPS protocol on your custom domain.
3. Set caching rules
You can use Azure Content Delivery Network (CDN) caching rules to set or modify default cache expiration behaviour both globally and with custom conditions, such as a URL path and file extension. Azure CDN provides two types of caching rules:
Global caching rules: These rules affect the CDN caching behaviour for all requests and can be overridden using custom Rules below for certain scenarios.
Custom caching rules: You can set one or more custom caching rules for each endpoint in your profile. Custom caching rules match specific paths and file extensions, are processed in order and override the global caching rule
You need to go through these steps:
- Open the caching rules page.
- Create a global caching rule.
- Create a custom caching rule.