Having a website that load super fast is very important. One of the factors used by search engine giant Google, in ranking website on SERP is speed. website that load fast tend to rank higher on search engine result page.
One way we can make our website load fast is the use of Content Delivery Network, say a user from south africa, is visiting your website hosted in an US server, it take several seconds for his request to travels to USA server and then receive a response. but with a CDN service, your cache copy of your website is served to the visitor from the CDN server closest to the user.
Hosting these files on your website server can increase your site loading speed as the files are downloaded each time a user is visiting pages of your website which in turn lead to unnecessary bandwidth consumption.
Good And Bad Practice
All too often, I find code similar to this when inspecting the source for public websites that use jQuery;
this shows that jQuery.min.js code resides in folder “js” on their server.
however, loading jQuery for instance from Google Hosted Libraries is considered the best practice as you reduce your own
bandwidth costs and ultimately help your website to load faster because the user has probably already
cached a copy of jQuery locally as a result of a visit to another website also using the Google CDN.
rather than use the above bad practice, you should include jQuery to your website via;
What are hosted libraries
List Of hosted libraries websites
jsDelivr is a public open-source CDN where anyone can submit a project to be hosted and delivered by our network. it doesn’t look at the popularity of the project to approve it for inclusion in jsDelivr. Plus a lot more types of projects are allowed, like CSS frameworks, fonts, WordPress plugins etc.
- CDNJs – Unlike to other hosted libraries that of Google or Microsoft, they only host the most popular libraries whereas CDNJS host the other stuff too with over 145 libraries wich is almost 15 times of libraries hosted at Google. CDNJS is powered by CloudFlare.
- Bootstrapcdn.com – if you’re looking for a CDN to host Bootstrap, the folks at NetDNA have graciously provided a free one.