Can I host Facebook all.js locally?

I noticed that sometimes the Facebook application runs slowly, and when it is checked, this is because the all.js file was not downloaded from the Facebook server, so I copied the file to my server and tested it.

Everything is working fine, and actually it is faster. My question is: do you know if there are any errors or errors in doing so?

+7
source share
3 answers

The problem is that now you are changing the dependency and also supporting this dependency for your local application. If it is hosted on Facebook servers, they can update it to fix errors or add features.

If you need a lot of time to download, you should pick it up in your support forums.

+5
source

Your page should load the all.js file anyway.

  • Facebook servers should be faster than the server hosting your Website. So, theoretically downloading a js file from facebook should be faster.
  • A better approach would be to cache the file for some time. This will make the page load after the initial, much faster.
  • As already mentioned, the all.js file is constantly updated with bug fixes, etc. Thus, it is always better to get the latest version of the file, rather than manually updating it on your server after a while.
+5
source

You may have problems using the facebook update API. You will need to regularly and frequently (every 5 minutes?) Update the file.

+2
source

All Articles