MyBB Community Forums

Full Version: All javascript libraries self hosted
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Google Hosted Libraries may have it's advantages in some cases, however I would prefer and suggest that MyBB 2.0 would not use it or any other similar services.

Self hosting jQuery would increase user's privacy when visiting your forum, also you could customize it as you see fit, if necessary.

Using google's services may potentially increase loading speed when visiting a page for the first time, however I don't see any other relevant advantage over self hosting it.

Some other comparisons here.
Uh MyBB DOES self host its JavaScript libraries.
Well loading is the only real difference true. Though the argument of security/downtime i find flawed with your link. Its so much more likely your own server will be hacked / is down then the server of google ever gets compromised so.
Unless MyBB customizes it there is no real reason not to use it, though since its so easy to customize i think it should just stay a template edit. For the Admin to change the local files to the CDN version.

For the rest this is currently already the case so.
If we do pick a CDN hosted library, it wouldn't be from Google. There are much faster CDN hosts available.
(2012-12-28, 10:57 PM)Nathan Malcolm Wrote: [ -> ]If we do pick a CDN hosted library, it wouldn't be from Google. There are much faster CDN hosts available.

But dont you intentionally pick google because almost everybody does? Meaning everybody almost already has those files from for example jquery from google on their computer? Could just be me thinking silly though.

PS: JQuery really should become part of webbrowsers.. and not have to be downloaded anymore.

edit removed a silly line about microsft being good well they offer a lot but they are not that fast :/
(2012-12-29, 12:39 AM)anori Wrote: [ -> ]
(2012-12-28, 10:57 PM)Nathan Malcolm Wrote: [ -> ]If we do pick a CDN hosted library, it wouldn't be from Google. There are much faster CDN hosts available.

But dont you intentionally pick google because almost everybody does? Meaning everybody almost already has those files from for example jquery from google on their computer? Could just be me thinking silly though.

That's a good point, but if we use a local version then the visitor would have to download it anyway. We might as well use something which is fast.

I'd be much happier to implement something which checks for a local version and serves that but fallback on a fast global CDN.
(2012-12-29, 12:46 AM)Nathan Malcolm Wrote: [ -> ]
(2012-12-29, 12:39 AM)anori Wrote: [ -> ]
(2012-12-28, 10:57 PM)Nathan Malcolm Wrote: [ -> ]If we do pick a CDN hosted library, it wouldn't be from Google. There are much faster CDN hosts available.

But dont you intentionally pick google because almost everybody does? Meaning everybody almost already has those files from for example jquery from google on their computer? Could just be me thinking silly though.

That's a good point, but if we use a local version then the visitor would have to download it anyway. We might as well use something which is fast.

I'd be much happier to implement something which checks for a local version and serves that but fallback on a fast global CDN.

Hmm that would be a great system indeed, to check if jquery is available and if isn't to grab it from a fast CDN.

Was looking around and found the page on css tricks about it, never realised it was as simple as:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="/assets/js/libs/jquery-1.5.1.min.js"%3E%3C/script%3E'))</script>

To have a fallback.
Quote:If we do pick a CDN hosted library, it wouldn't be from Google. There are much faster CDN hosts available.

Never heard that one. Source? Google's CDN is widely used for referencing jQuery. If that are better alternatives, why isn't the rest of the world using it?

Quote:I'd be much happier to implement something which checks for a local version and serves that but fallback on a fast global CDN.

Don't you mean the opposite? Load jQuery from a CDN and fallback to a local copy. In that case if the CDN ever goes down (highly unlikely, but still) there is a local copy of jQuery to fallback to. Also helpful for offline development. HTML5 Boilerplate encourages it and includes the snippet.

It's also worth noting jQuery 2.0 (which should be pretty stable by the time we get to writing the JS) will be dropping legacy support and as such it will be considerably smaller, resulting in a faster download of the library. Awesome for mobile, specifically. So that's cool. Toungue
(2012-12-29, 01:43 AM)Fábio Maia Wrote: [ -> ]
Quote:If we do pick a CDN hosted library, it wouldn't be from Google. There are much faster CDN hosts available.

Never heard that one. Source? Google's CDN is widely used for referencing jQuery. If that are better alternatives, why isn't the rest of the world using it?

http://blog.cloudflare.com/cdnjs-the-fas...on-the-web

Google is more popular so more people use it. cdnjs is a newer service and has less recognition. In my tests I found cdnjs to be 224% faster than Google CDN, with the exact same version and file size.

(2012-12-29, 01:43 AM)Fábio Maia Wrote: [ -> ]
Quote:I'd be much happier to implement something which checks for a local version and serves that but fallback on a fast global CDN.

Don't you mean the opposite? Load jQuery from a CDN and fallback to a local copy. In that case if the CDN ever goes down (highly unlikely, but still) there is a local copy of jQuery to fallback to. Also helpful for offline development. HTML5 Boilerplate encourages it and includes the snippet.

That is what I mean, yes. Shy Early morning. Sleepy
But is it not also true that by using Google (which many people do) - that a visitor to your site has a caged copy and so will not need to download anything from your site at all?

Of course, there is also the risk that some countries have banned Google so it is a good idea to use an alternate. I quite like the Microsoft cdn.
Pages: 1 2