Twitter 按钮和 Google Page Speed

发布于 2024-11-18 05:21:14 字数 1048 浏览 4 评论 0原文

在包含 Twitter 推文按钮的页面上,我收到来自 Google Page Speed 的警告:

以下资源具有相同的内容,但通过不同的 URL 提供。从一致的 URL 提供这些资源可节省 3 个请求和 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

以下资源具有相同的内容,但通过不同的 URL 提供。从一致的 URL 提供这些资源可节省 2 个请求和 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

为什么 Twitter 的 widgets.js 为每个组件提供不同的 URL,有什么办法可以解决这个问题吗?

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

The following resources 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小耗子 2024-11-25 05:21:14

它可能从不同的 URL 为它们提供服务,以平衡请求的负载;然而,正如页面速度正确指出的那样,在单个请求的上下文中这实际上是一个坏主意(尽管为不同的请求轮换域是有意义的),因为它会导致资源的缓存未命中。

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.

热鲨 2024-11-25 05:21:14

以下是 Twitter 工程师在 Twitter 网站论坛上的回答: https://dev.twitter.com /讨论/8671

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文