DFS 10.1.0 - Configuring Azure CDN
Azure CDN consists of two entities:
- Profile
- Endpoint(s)
A CDN profile is a container for the Endpoint(s), which specifies which provider to use. An Endpoint is the actual CDN configuration where the caching rules are setup. We refer to the Azure documentation on how to setup a Profile.
Setting up CDN Endpoint in Azure
Adding an Endpoint in Azure CDN, provides you the following dialog:
The parameters should be filled out as follows:
- Name: Is the name of the CDN and is going to be part of the CDN url
- Origin type: Azure specific thing. Set this to Custom Origin
- Origin hostname: URL of Sitecore (without http(s) specification)
- Origin Path: Specifies what the endpoint should listen to. In the Sitecore case, set to "/dfsmedia" as that is where assets are streamed from
- Protocol: Specify which protocols you want the endpoint to use and the ports
- Optimized for: Azure specific thing. See documentation
Once the Endpoint is created, the minimum required CDN setup is finished.
Optional configuration
Navigate to the endpoint and locate Caching rules in the left menu tree. This provides the following view:
In here, Global and Custom caching rules may be setup. These are rules on how the Azure CDN cache behaves. The most important parameters here are the Global caching rules, where you can setup a time to live on the cache. The default is 7 days.
If the Global rules are changed, it is important that the following parameters are set as follows:
- Caching behavior: Must be "Set if missing"
- Query string caching behavior: Must be set to "Ignore query strings"