locked
Who downloads the CDN? IIS or Browser? RRS feed

  • Question

  • User-1132163444 posted

    Hi,

    Please enlighten me, recently i use CDN for my JQuery and other JS and CSS libraries, but the problem is the Server somehow blocks the CDN path.

    Can someone explain to me the technical process on how CDN works in IIS?

    I was thinking that the client browser is the one that downloads the CDN file, but why do we need to unblock the CDN path in the server?

    Thanks

    Tuesday, May 23, 2017 11:34 PM

Answers

  • User-271186128 posted

    Hi johnjalani,

    Who downloads the CDN? IIS or Browser?

    That's browser downloads the script from CDN site.

    You could use the script on CDN such like this on your page:

    <script src="https://cdn.bootcss.com/jquery/3.2.1/core.js"></script>

    That's never worked on IIS , the script would download by browser.

    but why do we need to unblock the CDN path in the server?

    Why do you think the server has blocked access to CDN path? Could you provide some more detail information about this issue?

    Best regards,
    Dillion

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 24, 2017 3:24 AM
  • User-821857111 posted

    johnjalani

    so my question is why do i have to add cdnjs.com to web1's firewall?

    You shouldn't. The browser makes the requests for scripts direct to the CDN resource. The request is not routed through your server. Your inability to load the script was most likely due to some other temporary reason that resolved itself, and the adjustment to the firewall had no effect at all. It is a red herring.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 24, 2017 1:03 PM

All replies

  • User-271186128 posted

    Hi johnjalani,

    Who downloads the CDN? IIS or Browser?

    That's browser downloads the script from CDN site.

    You could use the script on CDN such like this on your page:

    <script src="https://cdn.bootcss.com/jquery/3.2.1/core.js"></script>

    That's never worked on IIS , the script would download by browser.

    but why do we need to unblock the CDN path in the server?

    Why do you think the server has blocked access to CDN path? Could you provide some more detail information about this issue?

    Best regards,
    Dillion

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 24, 2017 3:24 AM
  • User-1132163444 posted

    Hi, Thanks for your reply,


    I'm thinking the same, "That's browser downloads the script from CDN site."

    But initially when i tried adding that same <script> tag with the CDN path, and view the website while its hosted in a remote server, the Jquery file was not downloaded, i have notice when i press F12 in Chrome and checked the files, Jquery is not there, and there is also the '$' not recognize error in the console, so i was thinking that the CDN path is somehow block by the server, so we added the CDN path in the firewall allowed sites, and yes the website is now working and the jquery file is in indeed downloaded.

    so is this means the server is downloading the CDN path??
    If YES, it would invalidate it purpose to have the files nearest to the client for faster loading....or if NO, how come we need to allow the cdn path in the firewall of the server?

    thanks

    Wednesday, May 24, 2017 6:06 AM
  • User753101303 posted

    Hi,

    With F12 I would have checked as well the http request for the jQuery files to see what happens. You could also now use F12 and see if it is actually loaded from the CDN.

    I assume you were not using a browser on your server ?

    Edit:at worst I would have tried a simple .htm test page. If this is not an interpretation problem, the only thing I can think of is that you have still some other server side processing which is enabled (caching, minification ???). I would have really checked the http query with F12 to see where it is directed.

    Wednesday, May 24, 2017 7:31 AM
  • User-271186128 posted

    Hi johnjalani,

    I'm not sure whether the firewall was in the server or LAN.

    If the firewall was only in the server, I guess that you was run the app on your server's browser, and the request to CDN was prevent by the server's firewall.

    If the firewall was in the LAN, that's of course all requests to CDN will be prevented in LAN by firewall.

    Best regards,
    Dillion

    Wednesday, May 24, 2017 7:39 AM
  • User-1132163444 posted

    Hi everyone, 

    Thanks for your replies,

    this is the setup, we have a web server (lets call it web1) in the U.S. were we deploy our MVC websites, and me here in the Philippines trying to view the hosted website in my own work station via Chrome.

    I do implement Optimization "Bundle" but its only for our own JS files, for 3rd party files like jQuery, KnockoutJS and Bootstrap. it is just something like this
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

    so initially the '$ not defined' error shows up, at this point, i already assumed that the jQuery file is not downloaded. 

    my next move is I ask our SysAd which is in the U.S. and ask to add "cdnjs.com" (this is were we get our jquery and other libraries) to the allowed firewall in the web server (web1)

    after that, when i refresh my Chrome, its now working.

    Just to be clear, the client PC (my workstation is in the Philippines) is not part of any LAN/VPN or same network of web1.

    so my question is why do i have to add cdnjs.com to web1's firewall?

    Wednesday, May 24, 2017 12:00 PM
  • User-821857111 posted

    johnjalani

    so my question is why do i have to add cdnjs.com to web1's firewall?

    You shouldn't. The browser makes the requests for scripts direct to the CDN resource. The request is not routed through your server. Your inability to load the script was most likely due to some other temporary reason that resolved itself, and the adjustment to the firewall had no effect at all. It is a red herring.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 24, 2017 1:03 PM
  • User-1132163444 posted

    Hi,

    ok let me try removing the firewall allowed for the CDN path.

    Wednesday, May 24, 2017 10:29 PM
  • User-1132163444 posted

    Hi,

    Yup it worked when i removed the firewall allowed access to cdnjs.com.

    your right, it might have fix when i refresh the page.

    Again thanks for the replies

    Salamat po :)

    Thursday, May 25, 2017 1:35 AM