Reply to post: Re: Bloody stupid!

How one developer just broke Node, Babel and thousands of projects in 11 lines of JavaScript


Re: Bloody stupid!

It's done so that large libraries will not need to be downloaded by each visitor to your site as many will already have the library cached from another site.

Therefore, especially for mobile devices, having the various versions of jquery already cached on your device (from visiting a different site which uses the same resource from a central repository) means a much quicker download of your webpage. It can also reduce latency as the CDN is likely to be closer to your users for global queries, reduces bandwidth from your server and helps avoid any browser (or server) limits with parallel requests.

Sites that do this should use fall back of course to serve locally if the CDN is not available. However, as for privacy most sites are using Google analytics any way and for all their worth Google servers are pretty secure (at least from randomers).

There is tradeoffs of course an in an ideal world people would just use specific functions they require written in a pure scripting language (or even just a markup language) and not use libraries at all to minimise bloat etc. However this is the real world and browsers are optimised to run libraries fast and developers are expected to belt out solutions at a high rate of knots.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon


Biting the hand that feeds IT © 1998–2020