0
使用YSlow進行測量,它給my page一個F級,用於發出太多的HTTP請求。將我所有的javascript結合到一個文件中會導致更少的HTTP請求,但是在這種情況下可能嗎?我要讓我的網頁加載速度更快,所以我不知道是否是技術上是可行的一切組合成一個JavaScript文件,或者如果我在一個位置,我在那裏,我不能簡化組件的更多:我可以在本地保留一個腳本,例如apis.google.com/js/plusone.js嗎?
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '164355773607006', // App ID
channelURL : '//WWW.KOOLBUSINESS.COM/static/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
// Additional initialization code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script><script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=adsense"></script>
<script type="text/javascript" src="static/js/home.js"></script>