locked
CDN Fall back mechanism RRS feed

  • Question

  • Hi,

    I am using the CDN to store my JS CSS and Images in my project. I am accessing direclty from CDN. I want to know the CDN fall back mechanism which will help me in case of CDN failure, so that I can access images , JS, and CSS should access from local folders.?

    Thanks,
    Pavankumar Kulkarni

    Friday, June 5, 2015 2:36 PM

Answers

  • Can you provide more details on what is not working. Do you see a failure in getting the resource from the CDN endpoint? Does the request come back to the source origin? You should be able to see the requests in the IIS logs of the webrole instance.

    Regarding your question, you will need to add the scriptBundle for each of the jqueries you have like the example below shows(one each for "~/bundles/jquery","~/bundles/jqueryval etc).

    https://azure.microsoft.com/en-us/documentation/articles/cdn-cloud-service-with-cdn/#fallback-mechanism-for-cdn-urls

    bundles.Add(new ScriptBundle("~/bundles/jquery"<mark>, string.Format(cdnUrl, "bundles/jquery")</mark>).Include(
                   
    "~/Scripts/jquery-{version}.js"));

        bundles
    .Add(new ScriptBundle("~/bundles/jqueryval"<mark>, string.Format(cdnUrl, "bundles/jqueryval")</mark>).Include(
                   
    "~/Scripts/jquery.validate*"));

    Wednesday, June 10, 2015 3:40 PM

All replies

  • Hi Pavankumar,

    You may have to refer following link which provide you details about the Fall back mechanism :

    https://azure.microsoft.com/en-us/documentation/articles/cdn-cloud-service-with-cdn/#fallback-mechanism-for-cdn-urls

    Regards,
    Manu

    Friday, June 5, 2015 4:25 PM
  • Hi Manu,

    I used the same mechanism. it's not working for me. And I have a question here.

    Suppose if I have More than 50+ jqueries , then shall i need to mention them inside the RegisterBundle method?

    Kind Regards,

    Pavan

    Monday, June 8, 2015 5:45 AM
  • Can you provide more details on what is not working. Do you see a failure in getting the resource from the CDN endpoint? Does the request come back to the source origin? You should be able to see the requests in the IIS logs of the webrole instance.

    Regarding your question, you will need to add the scriptBundle for each of the jqueries you have like the example below shows(one each for "~/bundles/jquery","~/bundles/jqueryval etc).

    https://azure.microsoft.com/en-us/documentation/articles/cdn-cloud-service-with-cdn/#fallback-mechanism-for-cdn-urls

    bundles.Add(new ScriptBundle("~/bundles/jquery"<mark>, string.Format(cdnUrl, "bundles/jquery")</mark>).Include(
                   
    "~/Scripts/jquery-{version}.js"));

        bundles
    .Add(new ScriptBundle("~/bundles/jqueryval"<mark>, string.Format(cdnUrl, "bundles/jqueryval")</mark>).Include(
                   
    "~/Scripts/jquery.validate*"));

    Wednesday, June 10, 2015 3:40 PM