MyBB Community Forums

Full Version: Using Prototype from Googles API CDN - MyBB
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I don't know if this is the right place to post this, but I couldn't see it discussed on the forum. I saw a rejected enhancement, and it was rejected based on an installation issue...
h t t p://dev.mybboard.net/issues/626
However, if the enhancement is made after installing it shouldn't be a problem

If people want to update their MyBB form to use the Googles CDN prototype, then this is how I did it:

From the Admin control panel, go to
Templates & Style >>Templates >> Default Templates >> Header Templates >> Header

Then update the line that references the prototype to:
h t t p://ajax.googleapis.com/ajax/libs/prototype/1.6.0.3/prototype.js
(or what ever version you are using)

... Let me know if there is a more official MyBB method of doing this
(I think updating the mybb_theme.xml file before the install will cause the issue mentioned in the Bug#107)

... Taking advantages of googles cached scripts is pretty nifty for large frame works, I'm surprised the enhancement was rejected in the end.
For all that its worth, I found the CDN for prototype still having significant performance issues.
For those that want to try, and use a sluggish server, it might be worth it. But I haven't found the CDN for prototype to be hugely beneficial

However, I have found the CDN for JQuery (which is smaller / minified)[all are gzipped] to be a lot faster than using JQuery on my own network (but JQuery is not the standard library shipped with MyBB). From a small bit of testing, I would now reject my own suggestion if I could

<moving over to JQuery and using that from the CDN... would be more valuable, sounds like this is coming in 2.0, so all is good>


Smile
I hated when they included a link to an external script. I don't want to rely on third party webservers for my forums, thanks.
(okay, I can't do much about linked images, but it makes localhost testing a pain especially when Ctrl+F5 takes like 5-10 seconds to load)

As you probably alluded to, having it on the same server also allows the script to be transferred through keep-alive, so unless your server sucks, it'll actually be faster serving from your own server than Google's. Not to mention that not all networks are equal (I wouldn't be surprised if countries like China treat external traffic like Google in some special way).