6 ms·
I've read through the 100+ comments that preceded me, and I must be missing something stupidly obvious. Thanks in advance to anyone who can enlighten me. Can't
by darkandbrooding 13y ago
I've read through the 100+ comments that preceded me, and I must be missing something stupidly obvious. Thanks in advance to anyone who can enlighten me.
Can't you just host your own copy of JQuery? If your web app needs version x.y.whatever, is there some reason why you can't just host your own copy of the library on the same servers the provide the rest of your web content?
I understand the convenience of using some CDN's copy of JQuery, but I'm unsure why it's anything other than a convenience. Maybe it's about money: "It'll cost us an extra $X per month in bandwidth fees to host our own version of JQuery." Maybe it's about user experience: "By hosting JQuery on our own site we add 100ms to page load times."
To the people who seem most unhappy about the version bump, can you describe how hosting your own version of JQuery would complicate your lives? Just so there is no ambiguity, I'm asking from a point of ignorance, not snark. I would genuinely like to read the answers.
- crazygringo 13y agoThere is zero problem with hosting your own copy. Lots of people do. The main advantage to using a CDN is that a single copy can be cached across multiple websites, meaning that the first time someone visits your site, there's a good chance your version of jQuery already sits on their computer. Plus, the Google CDN will often serve content faster than your own site. And, since jQuery is now so "integral" to websites, it almost seems silly to have to maintain a copy of it yourself. But the main downside to using a CDN is that, CDN's have gone down before, and that means your site will stop working. Obviously, it doesn't happen often, but it happened once to a widely used site of a friend of mine, and he swore, never again will he reference jQuery on a CDN. I personally prefer to host myself too. (But not out of bandwidth savings, that just winds up being trivial.)
- Dave9k 13y agoYou can use a CDN and fallback to local if it goes down. http://stackoverflow.com/questions/5257923/how-to-load-local-script-files-as-fallback-in-cases-where-cdn-are-blocked-unavai http://stackoverflow.com/questions/5257923/how-to-load-local...
- crazygringo 13y agoI would be wary of that -- I assume it's likely that a CDN would often time out in case of error, which means you might be looking at 30 or 60 seconds until JavaScript works on your page.
- darkandbrooding 13y agoY'know, I hadn't even considered that your browser might already have a cached copy of JQuery because of a previous visit to some other site. Like the friend you mentioned, the idea of third-party hosting for a critical piece of infrastructure is a non-starter for me. If my site depends on X, I prefer (the illusion of) control over X.
- lessnonymous 13y agoIt's not about being able to access 1.x in the long term from a CDN. The problem is whether it will still be supported. If there are bugs in 1.x, will they be fixed? Will 1.x support Chrome v40 and IE 15?
- _sh 13y agoBackporting bugfixes has a cost. Requiring 1.x to support IE15 pushes that cost onto the jQuery developers instead of where it rightfully belongs: migrating your app to a recent version.
- darkandbrooding 13y agoThanks for the clarification. Although the JQuery team didn't announce any end date for support of 1.x, I appreciate the ticking clock implicit in the major version bump. I suspect that a comment made by user Zangrief is right on the money - enterprise users will increasingly take over maintenance of the 1.x branch out of necessity.