files from a website is easy just link to them and you’re done.
Serving files from your website in the most optimal way isn’t that easy, first
you have to think about things like making sure that the caching is right and
if the files are being used a lot on other sites.
are being used a lot on other sites then it could be that the user already has
a copy of this file lying around, let’s say you use jQuery on your site. You’re
not the only one using this library there are a lot of other websites that are
using this library which means that the people coming to your site might
already have jQuery running, to make sure these people don’t need to get yet
another copy of jQuery this can be
delivery: people in America will get it from local servers and so will people
from Europe or Asia
delivery: people who already have gotten the CDN version of that library won’t
need to download it again.
it actually costs your server a bit of time to handle the requests, it also
costs you a bit of bandwidth it costs you nothing to use a CDN.
Libraries which has:
There are a
couple of reasons not to use a CDN in specific circumstances.
applications hosted on a network: it’s always good in these cases to use local
files because you don’t need the internet to run this application.
files then it is best practice to combine and minify these files in some cases
this can render better results than using a CDN.
always good to use a CDN, above is a list of CDN’s which are widely used and
reliable so there is no excuse not to use these.