Inspired by Dave Ward to host javascript files externally, I have several questions concerning the hosting of Javascript files externally:
Everybody knows that known libraries can be directly sources to, for free:
//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
//ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js
The scope of this question however focuses to hosting custom javascript files externally:
Q1. Is it possible to host private JavaScript files on a fast free public CDN?
Q2. Are there any speed penalties or is hosting on third party CDN practically always better?
Q3. Are there any safety risks involved in hosting custom JavaScript files externally?
Thanks to 13 people who have favorited this question, I am reopening this question! As of 2021, lightning fast websites (with all their JavaScript components) its more important than ever before to gather a collaborative understanding of objective ways to speed up page load. Untill this question is reopened, feel free to comment below your answer/suggestions to the three questions!
If you're looking to host your CSS and JS files for free, there are a few different options available to you. One option is to use a free web hosting service such as 000webhost.com or x10hosting.com. Another option is to use a free file hosting service such as Dropbox or Google Drive.
jQuery CDN generates functioning code that works in various browsers in a shorter time. On the other hand, Web developers require the jQuery download file to parse the library. Raw JavaScript may be faster for some processes, but the advantages of jQuery UI CDN outweigh the disadvantages.
It is still beneficial to use a CDN, and it is still for your users' benefit, but the benefit is in reduced latency with geo-located servers, not in general performance due to a hot cache hit.
jsdelivr is a free, fast and reliable service to host your javascript files on a CDN.
The file should be on github repository first, then use the following format to use the CDN:-
https://cdn.jsdelivr.net/gh/user/repo@version/file
In the above format replace user with your username on github, repo with repository name and version with the version of your repository
You can use this CDN service for hosted anywhere like npmjs.com or even on your wordpress sites using their plugin.
Please visit the website for more information and to know how it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With