Serve resources from a consistent URL: facebook vs Google Pagespeed
Asked Answered
B

3

19

There is a common problem on using Facebook like button or box, on using pagespeed online sevice by Google I get this : Serve resources from a consistent URL The following resources have identical contents, but are served from different URLs. Serve these resources from a consistent URL to save 1 request(s) and 25.3KiB. - http://static.ak.facebook.com/connect/xd_arbiter.php?version=7 - https://s-static.ak.facebook.com/connect/xd_arbiter.php?version=7

it is obvious that one is for secured ssl connection and other is for unsecured connection is there any possible way to make facebook load just one?

Bucolic answered 12/6, 2012 at 15:12 Comment(7)
Wait, what are you trying to do? Why not use the og:url meta tag to tell facebook one of the URLs is canonical?Hooks
i am trying to post like button and box will this og remove this error?Bucolic
I don't understand your problem - if you have two places you are accessing the same content, redirect users from one to the other - the og:url suggestion achieves the same effect for Facebook shares or likes of your links - it causes facebook to treat the two links as the same (i.e whichever URL is contained in the og:url tag is canonical, and the pages which CONTAIN the og:url are possible ways of accessing that URL's contents)Hooks
the problem is from facebook itself :) I added the og:url and it also loads both files this is in all websites not just mine and I am asking if there is a way to make facebook load just one see this developers.google.com/speed/pagespeed/…Bucolic
this is not a problem of duplicate content on my site, it is duplicate content on facebook !!Bucolic
Then it's out of your controlHooks
sigh I usually refraing from meta comments, but more constructive comments are welcome :) The problem exists - I suffer from it too - and while we cannot change Facebook code, there still might be ways to solve this issue. So I don't agree it's de facto out of our control. Bottom line: still looking for a solution.Pissarro
S
3

If you want Facebook to load just one, you need to serve the containing page over https.

Here's a demonstration:

Visit:

Facebook site with HTTP

You'll notice it shows Serve resources from a consistent URL for xd_arbiter, now visit:

Facebook site with HTTPS

You'll notice Facebook only loaded the https version as we served the page over https. I'm not sure if this is a Facebook issue. It may be worth filing a bug with Facebook, you'll at least get some useful feedback, (I tried to but couldn't find out where you can file bugs for these things, http://developers.facebook.com/bugs/ seems inappropriate)

Edit: Updating broken links, Facebook seems to have fixed the original issue and these links no longer show the problem that they used to highlight.

Saprophagous answered 22/5, 2013 at 16:21 Comment(0)
P
0

Facebook supports returning pictures over SSL. This may apply to other resources as well.

It might be worth appending ?return_ssl_resources=1 to your urls to see if this works for your resources. Facebook docs are notoriously incomplete, so the functionality may exist. Hope that helps!

Polyphemus answered 23/5, 2013 at 15:2 Comment(2)
sorry, but adding "?return_ssl_resources=1" to share url? or to all my urls?? this also btw will have a bad seo impactBucolic
Just the Facebook plugin urls.Polyphemus
D
-1

js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";

I suppose problem is here.

you may try to add http: to avoid connection to https:

I do not tested and can't confirm it helps or raise some issues to like button

Dextrorotation answered 13/6, 2012 at 15:0 Comment(2)
I just thought like you :) tried it in both ways, http and https...any way...both are loadedBucolic
That's what happens when you "do not tested". You get downvoted.Areaway

© 2022 - 2024 — McMap. All rights reserved.