PageSpeed reports Twitter URL being included twice


#1

When using PageSpeed Tool for Firefox It reports the following:

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.5KiB.

http://static.ak.facebook.com/connect/xd_arbiter.php?version=8
https://s-static.ak.facebook.com/connect/xd_arbiter.php?version=8

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 20.0KiB.

http://platform.twitter.com/widgets/hub.html
https://platform.twitter.com/widgets/hub.html

If I view the CSS using FF webdeveloper addon I can also see that this is happening (Slightly odd that FB is doing the same thing but I guess we’ll ignore that for the purposes of this discussion) I have contacted xcart as I thought it might be due to their Socialize Module but they report that this is being caused by the script:

http://platform.twitter.com/widgets.js

That is called for the Tweet Button.
Any help or advice is greatly appreciated


#2

What about this issue?
I have the same problem.


#3

Hi!

It’s interesting that we and the Facebook folk have the same issues here. Just to explain: When you use Web Intent events we create a “hub” on your page, which passes the event messages around between widgets and web intents and your main document.

Because logged in Twitter users always use HTTPS for authenticated content (like the follow button), we need to have a hub available on both HTTP and HTTPS protocols for the messages to be passed between. This is why the same resource is loaded from different protocols.

I’ll take a look into why you’re not seeing a better cached, hashed version of the hub document though (e.g. “Hub.123abfcd3432.html”), that should cache better than the regular version.


#4

Thank you very much, Ben!
I’ll try to follow your recommendations.


#5

@BenWard Can you recommend any resources to read for us to understand better why the HTTP hub can’t be left out? (I realize HTTPS must be included for a secure connection back to Twitter)

For what it’s worth, I do not see Facebook doing this, seemingly because they use a single JS to load an iframe which then contains the bridge. Perhaps this doesn’t actually make any difference, other than not having “Page speed” complain about it.

Edit: Redact that Facebook statement, I still see it in Page Speed on some pages…


#6