Hello guys,
As you all know I'm making my very first portfolio website. So I'm using jQuery for some stuff.
So should I use CDN of jQuery of download it locally and then link.
What will be more effective?
Share your thoughts and experience.
Hello guys,
As you all know I'm making my very first portfolio website. So I'm using jQuery for some stuff.
So should I use CDN of jQuery of download it locally and then link.
What will be more effective?
Share your thoughts and experience.
For further actions, you may consider blocking this person and/or reporting abuse
Abhay Singh Kathayat -
Abhay Singh Kathayat -
Abhay Singh Kathayat -
Prince -
Top comments (4)
You can do both. Use a CDN:
Then use your local copy as a fallback:
From: timjames.me/jquery-and-jquery-ui-f...
If you know what you want to use, use a local copy of jQuery, so you are not dependent on a third party.
If you try out things with several libraries, use the CDN, because it's quicker and once you're done, use local copies for the reason mention before.
The performance argument, that someone could have a cached copy of that same version of jQuery, from the same CDN in their cache and therefore the browser doesn't have to load it is negligible.
Also, linking to a third party exposes the visitor IP to them. Depending on privacy laws, you might have to disclose that and it saves you the hassle to do that if you use local copies.
CDN
Depends on your preference actually. If you want to serve static sites only and prefer a runtime inclusion, then CDN suits you. Be careful to take care of security though. It's untrusted third party, and you have no control over the changes in the source.
However, if you're more comfortable with a compile time engagement than runtime engagement, then use package manager. A little safer, since you know what version of library you're including.