开发者

Twitter button and Google Page Speed

On a page that has Twitter's Tweet buttons, I get warnings from Google Page Speed:

The following resour开发者_运维问答ces have identical contents, but are served from different URLs. Serve these resources from a consistent URL to save 3 request(s) and 52.0KiB. http://platform0.twitter.com/widgets/tweet_button.html http://platform1.twitter.com/widgets/tweet_button.html http://platform2.twitter.com/widgets/tweet_button.html

The following resources have identical contents, but are served from different URLs. Serve these resources from a consistent URL to save 2 request(s) and 4.6KiB. http://platform0.twitter.com/widgets/images/tweet.png http://platform1.twitter.com/widgets/images/tweet.png http://platform2.twitter.com/widgets/images/tweet.png

Why does Twitter's widgets.js serve up different URLs for each of these and is there any way around it?


It probably serves them from different URLs to load-balance the requests; however, as page speed correctly points out, this is actually a bad idea to do within the context of a single request (though it makes sense to rotate the domains for distinct requests), since it results in a cache miss of the resource.


Here is the answer on the twitter for websites forum, by a Twitter engineer: https://dev.twitter.com/discussions/8671

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜