简体   繁体   English

如果CDN启用了Http2,是否需要在Apache服务器上启用http2

[英]Do we need to Enable http2 on Apache server , If the CDN has Http2 enabled

We have a website which is in CDN and HTTP2 is enabled . 我们有一个CDN网站,并且启用了HTTP2。 Does it makes any difference if we enable HTTP2 with Apache server. 如果我们在Apache服务器上启用HTTP2,这有什么区别吗?

It depends on the CDN you are using and if they can speak HTTP/2 back to the origin server. 这取决于您使用的CDN以及它们是否可以与原始服务器说HTTP / 2。 Cloudflare for example only uses HTTP/1 back to origin: Can i use HTTP/2 between origin and cloudflare servers?(Apache) 例如,Cloudflare仅使用HTTP / 1返回源: 我可以在原始服务器和cloudflare服务器之间使用HTTP / 2吗?(Apache)

Most of the benefit of HTTP/2 is client to first point of contact (ie the CDN) as HTTP/2 improves lower latency, lower bandwith connections. HTTP / 2的大多数好处是客户端到第一接触点(即CDN),因为HTTP / 2改善了较低的延迟,较低的带宽连接。 CDN to Origin servers connections are likely to be higher latency and higher bandwith so are likely to benefit less from HTTP/2 over HTTP/1. CDN到Origin服务器的连接可能会有更高的延迟和更高的带宽,因此从HTTP / 2到HTTP / 1的收益可能会更少。

Finally using a CDN is one of the easiest ways to give you HTTP/2 without having to make any changes on your side, so yes it's perfectly acceptable to leave the origin server over HTTP/1. 最后,使用CDN是向您提供HTTP / 2而不需要您进行任何更改的最简单方法之一,因此,是的,将源服务器保留在HTTP / 1上是完全可以接受的。 Obviously that means you won't benefit the full way, and may not be able to use things like server push (unless implemented at the CDN level), but it still should be a good improvement until HTTP/2 becomes more readily available in server distributions. 显然,这意味着您将无法完全受益,并且可能无法使用服务器推送之类的功能(除非在CDN级别上实现),但这仍然是一个不错的改进,直到HTTP / 2在服务器中更容易获得为止分布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM