Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Better to host JS and CSS on CDN?

    Is it better to host your CSS and JS files on a CDN? Kinda expecting everyone to say yes - are there any catches?

    Thanks!

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,783
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    No, it is not. In fact, I’ve grown tired of people outsourcing every little script to a CDN or serving their stuff from GitHub or whatever without making sure the site at least works without JavaScript or having a fallback solution in case the CDN isn’t available. Since it’s also possible to block JS in part (e. g. only from third party domains) it is annoying to have to activate/enable dozens of scripts separately because they are served from elsewhere just because some lazy developer thought “it is so easy and everybody does it”.

    Also, all the advantages people always claim CDNs have are, if you actually think this through, negligible for most sites. Interesting article with lots of counterpoints in the comments here: http://zoompf.com/2010/01/should-you...t-library-cdns

  • #3
    Regular Coder
    Join Date
    Mar 2011
    Posts
    164
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by VIPStephan View Post
    No, it is not. In fact, I’ve grown tired of people outsourcing every little script to a CDN or serving their stuff from GitHub or whatever without making sure the site at least works without JavaScript or having a fallback solution in case the CDN isn’t available. Since it’s also possible to block JS in part (e. g. only from third party domains) it is annoying to have to activate/enable dozens of scripts separately because they are served from elsewhere just because some lazy developer thought “it is so easy and everybody does it”.

    Also, all the advantages people always claim CDNs have are, if you actually think this through, negligible for most sites. Interesting article with lots of counterpoints in the comments here: http://zoompf.com/2010/01/should-you...t-library-cdns
    Interesting stuff....ill read the article later in more depth. I guess that images are always recommended on CDN's though...right?

  • #4
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    but that makes no sense at all. think about it.
    if your server goes offline, then what good will CDN-stored contents be?
    it makes sense if you need to serve big files over the ocean, but otherwise...

    plus from SEO point of view: if you have stuff on CDN server, then you are not being credited for it.

    -------------------------------------------------------------------------------
    "Real Programmers can write assembly code in any language" - Larry Wall

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Having the entire page on one server makes the most sense - that way you are only relying on one server being up for your page to display and function.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •