CDN Stands for Content Distribution Network or also called Content Delivery Network is a large distributed system of servers deployed in multiple data centers in the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance. There are several advantage of using CDN.
- Reduce Load: It reduces the load on your web server as it downloads from Google server's.
- Caching: The most important benefit is caching. If any previously visited site by user is using jQuery from any CDN then the cached version will be used. It will not be downloaded again.
- Serves fast: You will be also benefited from speed point of view. As CDN has dozen's of different servers around the web and it will download the jQuery from whichever server is closer to the user.
- Parallel Downloading: As the jQuery js file is on a separate domain, modern browsers will download the script in parallel with scripts on your domain.
- Microsoft
- jQuery
Code to load jQuery Framework from Microsoft CDN
Code to load jQuery Framework from jQuery Site(EdgeCast CDN)
It is a good practice to use CDN but what if the CDN is down (rare possibility) but you never know in this world as anything can happen. So if you have loaded your jQuery from any CDN and it went down then your jQuery code will stop working. To handle such situation you can "Load jQuery locally when CDN fails".
No comments:
Post a Comment