在 bootstrap 期间,在 Cloudfront 中为 SPA 打开 http/2.0 的改进对于大型站点的普通用户来说是否很明显?

Is the improvement from switching on http/2.0 in Cloudfront for an SPA noticeable for the average user of a large site during bootstrap?

我们在 backbone 和 Angular 中有一个大型 SPA,它为拥有大量用户的金融系统调用一组 Java API。

一个人说:

Switching on http/2.0 will have a massive different for our users in terms of page load time due to the nature of the protocol.

另一个人说:

Browsers like Chrome are actually pretty good even without http/2.0. Switching it on won't make a noticeable different to the end user.

我们进行了更改,并测量了更改前后的静态页面加载时间。我们没有看到更改前后超过 48 小时的数据有任何差异。 (通过两个浏览器测试,并在我们的日志中获取从浏览器转发到应用程序的页面加载时间的日志数据。)

我的问题是:Cloudfront 中打开 http/2.0 对于 SPA 在 [=31= 期间对大型网站的普通用户来说是否明显? ]?

恐怕回答起来太模糊了。

需要考虑的一些事项:

  • 您的网站是否使用 HTTP/1 性能问题解决方法(例如 HTTP/2(似乎消除了对这些的需求)没有提供真正明显的性能优势?

  • 您的网站是否充满了糟糕的 JavaScript,以至于 HTTP 下载(HTTP/2 看起来效率更高)是性能问题中很小且几乎不引人注意的部分事情的规模?

  • 您的站点带宽是否受到限制(例如充满印刷质量图像),因此带宽而不是 HTTP 排队才是问题所在?

  • 您的后端 and/or 网络服务器是否如此糟糕,以至于需要很长时间才能生成您的页面,所以 HTTP 传输部分又是一个很小的问题,几乎不引人注意?

  • 您的网站是否真的很小,只有一个 HTML 页面和一个 JavaScript 负载?

  • 您的站点是否可以针对 HTTP/2 进行更优化(例如,将所有内容托管在一个域中,可能使用 HTTP/2 推送...等)让您获得比 HTTP/2?

  • 更好的性能

所有这些都会影响切换到 HTTP/2 是否会产生显着差异。 Google found that a sample of sites get a 27%-60% performance improvement for SPDY(HTTP/2 是基于),但它确实取决于相关站点。

最终 HTTP/2 旨在提高下载许多资产的效率,因为这在 HTTP/1 下效率低下 - 特别是在低延迟条件下。如果您没有很多资产,或者下载这些资产不是问题,那么 HTTP/2 那么您可能不会注意到太大的差异。

我有一个 blog post to help show the problems in HTTP/1 that HTTP/2 looks to address (including analysing a real world example - Amazon.com) which may help you look at your site for the same potential issues (full disclosure it’s part of a book I’m writing on the subject).