[RFC|Merged] Use Google's jQuery

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.1/Ascraeus branch. Everything listed in this forum will be available in phpBB 3.1.
Post Reply
User avatar
sooskriszta
Registered User
Posts: 85
Joined: Wed Dec 29, 2010 7:23 pm

[RFC|Merged] Use Google's jQuery

Post by sooskriszta »

I understand that 3.1 will ship with jQuery. This is great!

Can you also add the option for admin who can decide to use Google's libraries instead (via AJAX libraries API http://code.google.com/apis/libraries/)? There are at least 2 benefits:
1) Many large sites use Google's libraries so there's a very high probability that these are already cached on the user's computer.
2) Even if the libraries aren't already cached, it could speed things up as
a) The libraries are coming from a different domain, so for browsers that limit parallel threads from 1 domain this can help,
b ) Google has a very massive CDN and serving anything through that implicitly speeds things up

If I understand corectly, Google has following libraries available:
Dojo
Ext Core
jQuery
jQuery UI
MooTools
Prototype
script.aculo.us
SWFObject
WebFont Loader

Ticket: http://tracker.phpbb.com/browse/PHPBB3-10390
OC2PS
Testfestés, Arcfestés, Csillámfestés

Alapanyagok, Képzések, Ismertetők
Hennafestés
GMAT coaching and MBA Admissions Consulting
formerly known as sooskriszta

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: Use Google's jQuery

Post by callumacrae »

While I kind of like the idea, I don't think it will ever be accepted. There are two reasons for this: firstly, if the google CDN goes down then tonnes of boards go down - this is not true, as it is really easy to write a fallback (see html5bp and how it does it). Secondly is security - phpBB does not allow remote scripts in case the third party server is hacked and malicious code sent. This being google CDN, I can't see that happening.
Made by developers, for developers!
My blog

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 557
Joined: Thu Sep 07, 2006 11:22 am
Location: Karlsruhe, Germany
Contact:

Re: Use Google's jQuery

Post by bantu »

There are quite a few reasons why phpBB should not use a CDN by default.
  • Private networks: phpBB has to function properly without an internet connection.
  • Privacy: A request to a phpBB board sends a request to the CDN.
Considering this, JavaScript libraries have to be shipped with phpBB and have to be delivered from the webserver where phpBB is running on by default.

However, we should make it pretty easy to use a service like a CDN.

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: Use Google's jQuery

Post by callumacrae »

bantu wrote:There are quite a few reasons why phpBB should not use a CDN by default.
  • Private networks: phpBB has to function properly without an internet connection.
  • Privacy: A request to a phpBB board sends a request to the CDN.
Considering this, JavaScript libraries have to be shipped with phpBB and have to be delivered from the webserver where phpBB is running on by default.

However, we should make it pretty easy to use a service like a CDN.
I hadn't considered the privacy argument, but the connection argument is invalid - a one line fallback is all that is required.
Made by developers, for developers!
My blog

User avatar
sooskriszta
Registered User
Posts: 85
Joined: Wed Dec 29, 2010 7:23 pm

Re: Use Google's jQuery

Post by sooskriszta »

bantu wrote:phpBB should not use a CDN by default.
I agree - by default phpbb should use the libraries it ships with. However, I would submit that it is very beneficial to many boards to have an option to check a box in ACP that makes phpbb use Google libraries instead.
OC2PS
Testfestés, Arcfestés, Csillámfestés

Alapanyagok, Képzések, Ismertetők
Hennafestés
GMAT coaching and MBA Admissions Consulting
formerly known as sooskriszta

User avatar
callumacrae
Former Team Member
Posts: 1046
Joined: Tue Apr 27, 2010 9:37 am
Location: England
Contact:

Re: Use Google's jQuery

Post by callumacrae »

sooskriszta wrote:I agree - by default phpbb should use the libraries it ships with. However, I would submit that it is very beneficial to many boards to have an option to check a box in ACP that makes phpbb use Google libraries instead.
+1 (and a text input to allow the user to specify a remote library, although it should default to google)
Made by developers, for developers!
My blog

User avatar
nickvergessen
Former Team Member
Posts: 733
Joined: Sun Oct 07, 2007 11:54 am
Location: Stuttgart, Germany
Contact:

Re: Use Google's jQuery

Post by nickvergessen »

This could be an easy MOD
Member of the Development-TeamNo Support via PM

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: Use Google's jQuery

Post by naderman »

I agree that we should provide this option by default.

User avatar
MattF
Extension Customisations
Extension Customisations
Posts: 675
Joined: Mon Mar 08, 2010 9:18 am

Re: Use Google's jQuery

Post by MattF »

nickvergessen wrote:This could be an easy MOD
naderman wrote:I agree that we should provide this option by default.
Didn't I already present this many months ago? ;)

viewtopic.php?f=108&t=33747&start=50#p224199
Has an irascible disposition.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: Use Google's jQuery

Post by naderman »

VSE+ wrote:
nickvergessen wrote:This could be an easy MOD
naderman wrote:I agree that we should provide this option by default.
Didn't I already present this many months ago? ;)

viewtopic.php?f=108&t=33747&start=50#p224199
Yup and I still agree with you. Maybe you want to write a patch for this? :)

Post Reply