Topic-icon Loading JFB connect/Facebook JS on homepage

Active Subscriptions:

None
13 years 3 months ago #31121 by mhanagan
Hi,
Just a quick question if there is any way to supress the loading of the Facebook connect JS files on my homepage? I don't actually have the Login With Facebook button on that page and it slows my page load by quite a bit (mostly calling to Facebook)
js.src = "//connect.facebook.net/en_GB/all.js";

for example sometimes takes 2.5 seconds to recieve.

Is it needed on the homepage if I don't have the JFB connect buton on there?

Thanks much,

Matt
The topic has been locked.
Support Specialist
13 years 3 months ago #31129 by alzander
Matt,
There's a lot of features that rely on the Javascript library loading. Things such as the auto-login functionality, Page Tab or Canvas integration, Open Graph actions, and I'm sure a few others I'm missing. So, even if you don't have a 'button' or other visible widget, the Facebook Javascript can still be necessary.

With that said, frankly, it shouldn't take that long to load. First, it should be cached by your browser at least for a little bit, which should make it not have to load on each page load. Also, the script is set to load after the page has been delivered to the user. So, even if the download of that file takes a little extra, it shouldn't prevent the page from being viewed. Finally, we initialize the JS library with the barest minimum of features required for what you have enabled. That doesn't mean it's always speedy, but it is as fast as we think we can make it load.

With all that said, there is probably a few lines of code we could help you add to JFBConnect which could prevent it on that page. The problem is that you'd have to make that change whenever you upgrade and it would prevent other features, as mentioned above.

Let us know if that helps or you want us to look into the code required.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 3 months ago #31158 by mhanagan
Thanks very much for the reply Alex. I think it may have been an issue on Facebook's end pulling in the script. It seems fine now so no worries. Thanks again for the excellent support. I'll be sure to rate your app on Joomla :)
The topic has been locked.
Support Specialist
13 years 3 months ago #31159 by alzander
Matthew,
Glad to hear it. 2.5s for pulling that script is definitely excessive, so I'm happy to hear it was likely just a temporary glitch.. which can happen. Should you need anything else, just let us know.

Finally, as you mentioned, we'd love it if you'd consider leaving a rating and review for JFBConnect, or our support, on the Joomla Extension Directory. It certainly isn't required, but is very appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks, and good luck,
Alex
The topic has been locked.