I was running page speed insights on my website and was given the following result:
Compressing resources with gzip or deflate can reduce the number of bytes sent over the network.
Enable compression for the following resources to reduce their transfer size by 350.1KiB (71% reduction).
Compressing https://static.xx.fbcdn.net/rsrc.php/v2/yV/r/jchZvGuNSq4.js could save 230.8KiB (72% reduction).
Compressing http://connect.facebook.net/en_US/sdk.js could save 119.3KiB (69% reduction).
I am wondering if anyone knows how to compress these files since they are served out directly from the facebook sdk?
This is the facebook script I am using in my webpages:
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '---- my app ID here -----',
xfbml : true,
version : 'v2.4'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.4";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
Any help would be greatly appreciated as I have been unable to find a clear answer to this identified problem.
Gzip on Windows Servers (IIS Manager)Open up IIS Manager. Click on the site you want to enable compression for. Click on Compression (under IIS) Now Enable static compression and you are done!
Upon activation, go to the Settings » WP Super Cache page » Advanced in your WordPress dashboard. Then, simply check the box 'Compress pages so they're served more quickly to visitors' box. You then need to scroll down the page and click the 'Update Status' button to save your changes.
Gzip, the most popular compression method, is used by web servers and browsers to seamlessly compress and decompress content as it's transmitted over the Internet. Used mostly on code and text files, gzip can reduce the size of JavaScript, CSS, and HTML files by up to 90%.
You can't. It's served from a third party which is Facebook. We should reach them out and ask them to compress these files.
Edit:
Facebook actually lent us an ear, and compressed some of their SDKs which is great
I have also noticed this and went Googling and found your SO question. I did some checks and it looks like they already compress their static files. Have a look at this:
http://www.whatsmyip.org/http-compression-test/
EDIT: I recommend using https://checkgzipcompression.com/ now, the previously named test seems to have lost its functionality
I'm not sure why Pagespeed Insights doesn't pick up on this, but I am pretty sure you can ignore this. Because you don't have much influence on the way they serve their static files and I would be suprised if they didn't compress their static files at a company like Facebook.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With