Hi, I've already read the readme.txt and the documentation and never found this case.
I've found on fb.js that 'all.js' from connect.facebook.net is called using jQuery.getScript which doesn't cache on user browser.
This 'all.js' script (26.5 KB) will pulled from facebook server each time the page load which is very time consuming depending on inet connection. My question: is all.js meant Not to be cached on user browser ?
after googling, I find there is a way to cache the external js with this code (I've already test it and it works):
jQuery.ajax({
type: "GET",
url: "http://connect.facebook.net/en_US/all.js",
success: function(){},
dataType: "script",
cache: true
});
thank you in advance
Comments
Comment #1
Dave Cohen commentedDo you have a patch?
Comment #2
rei commentedhere it is
Comment #3
mrfelton commentedThis seems like a pretty good solution. Is this being considered for inclusion? If not, why not?!
Comment #4
Dave Cohen commentedBecause I lost track of it....
I just checked in a change to use
<script...>instead of jQuery.getScript(). Can you update to the latest and tell me whether that solves this problem.At the same time, I'm trying to solve #1034222: load facebook javascript asynchronously. Please weigh in if you see a way to solve both problems.
Comment #5
abdobasha2004 commenteddoes this needs jQuery? I do not load it on my site, should I load it for just this?
Comment #6
Dave Cohen commentedDrupal should initialize jquery automatically. Unless you've done something to explicitly not load it, it will be loaded. modules/fb/fb.js assumes jQuery has been loaded.