Raul Leaño Martinet
Raul Leaño Martinet

Reputation: 2113

Can I host Facebook's all.js locally?

I've been noticing that sometimes my Facebook app runs slow, and when checked it was because the all.js file was not loaded from the Facebook server, so I copied the file ontp my server and tested it.

Everything seems to work fine, and actually it runs faster. My question is - do you know if there are bugs or errors in doing this?

Upvotes: 7

Views: 5280

Answers (3)

Gaurav Swaroop
Gaurav Swaroop

Reputation: 1221

Your page has to load the all.js file in any case.

  • Facebook servers should be faster than the server which host your website. So, theoretically loading the js file from facebook should be faster.
  • A better approach would be to cache the file for some time. This will make the page loads after the initial one much, much faster.
  • As people have mentioned, the all.js file is updated constantly with bug-fixes etc. So, it is always better to get the newest version of the file instead of manually updating it on your server after some time.

Upvotes: 5

Joel Martinez
Joel Martinez

Reputation: 47809

The problem here is that now you're shifting a dependency, and by extension the maintenance of that dependency to your local application. If it's hosted on Facebook's servers, they can update it to fix bugs or add features.

If it's taking a long time to load, you should bring it up on their support forums

Upvotes: 5

Gregory
Gregory

Reputation: 493

You can have some problems when the facebook update API. You will need to regularly and frequently (every 5 min?) update the file.

Upvotes: 2

Related Questions