locked
Azure CDN - structural questions RRS feed

  • Question

  • Hello,

    I have an Azure hosted VM that securely serves my marketing websites. Right now I am CNAMEd to it up in Azure (the DNS is my custom domain name and it points to an azure name). I am interested in trying out the new Microsoft CDN with it - specifically to accelerate static assets (images, js, css etc).

    In the past I have used Akamai and the setup there was basically to point your domain name to them, then they point to the origin. It was essentially a proxy to my origin. Anything that could be cached, was cached along the way, anything else just passed through it. Is that how this works?

    How can I have a CDN endpoint that is www.mysite.com and an origin that is up in Azure IAAS?

    How can I accelerate only certain bits of the site and not have to "split" the site to serve static assets from the CDN and dynamic assets from my existing domain?

    What are the various bits I am asked to setup while going through the process for adding CDN Profiles and endpoints?

    I am just a little confused about how to do the "simple" case that I have at the moment.

    Thanks,

    Judd

    Monday, June 25, 2018 5:14 PM

Answers

  • Hi Judd, 

    Same as the set up with Akamai, you point your domain name to Azure CDN endpoint, which points to your origin. Create a CDN endpoint, then add your domain name as "custom domain" in the CDN management.

    Regarding managing caching, you can control which content needs to be cached by CDN vs. bypassed through CDN to go back to your origin. By default CDN uses "cache-control" header and honor that value, check this doc: https://docs.microsoft.com/en-us/azure/cdn/cdn-how-caching-works. You can also set up caching rules on CDN, check this doc: https://docs.microsoft.com/en-us/azure/cdn/cdn-caching-rules. 

    Manling

    Tuesday, June 26, 2018 6:17 PM

All replies

  • Hi Judd, 

    Same as the set up with Akamai, you point your domain name to Azure CDN endpoint, which points to your origin. Create a CDN endpoint, then add your domain name as "custom domain" in the CDN management.

    Regarding managing caching, you can control which content needs to be cached by CDN vs. bypassed through CDN to go back to your origin. By default CDN uses "cache-control" header and honor that value, check this doc: https://docs.microsoft.com/en-us/azure/cdn/cdn-how-caching-works. You can also set up caching rules on CDN, check this doc: https://docs.microsoft.com/en-us/azure/cdn/cdn-caching-rules. 

    Manling

    Tuesday, June 26, 2018 6:17 PM
  • Hi Manling,

    Thanks for the response. I just want to be super explicit to make sure I get it.

    Say we have the following:

    websitecdn.azuredge.net (the azure CDN endpoint)

    www.website.com (my site that I want to accelerate)

    I need the following..?

    I would need some sort of "site name" for my origin that would not be the normal thing, like:

    origin.website.com

    Then I would have a chain like this:

    DNS CNAME: www.website.com -> websitecdn.azuredge.net 

    Azure config: websitecdn.azuredge.net -> origin.website.com

    And I would have to emit headers to the client with the correct cache controls and the Azure CDN would pass "www.website.com" as the domain in its request headers?

    Do I have that correct?

    Thanks,

    Judd

    Wednesday, June 27, 2018 3:16 PM
  • Yes the workflow you have described is one way to achieve this. In your workflow you are having all requests to your website flow through the CDN. Another, and very common option, is to just use the CDN to just handle specific static or dynamic assets. For example, in your case of accelerating performance for static assets you could leave www.website.com directly pointing to your Azure hosted VM and then update your static assets to be accessed directly from the CDN e.g. http://websitecdn.azureedge.net/sampleimage.jpg. If you want to use your own custom domain for accessing these assets you can still achieve this - e.g. http://cdn.website.com/sampleimage.jpg. In this case you would have the following DNS CNAME mappings:

    Azure VM DNS CNAME setting:

    www.website.com -> origin.cloudapp.net

    Azure CDN DNS CNAME setting:

    cdn.website.com -> websitecdn.azureedge.net

    CDN endpoint configuration:

    websitecdn.azureedge.net -> origin.cloudapp.net

    Wednesday, June 27, 2018 6:19 PM
  • Ya, I did not want to split the hosting like that - zero impact to the existing site except for the DNS changes. I am going to cobble together a test environment to check this out and see if I can get it running.
    Wednesday, June 27, 2018 6:46 PM