HTTP 2.0 与 tomcat
Posted 二郎那个三郎
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTTP 2.0 与 tomcat相关的知识,希望对你有一定的参考价值。
tomcat 支持http2.0吗?
首先,HTTP2.0协议一级公布,只是推广和各个中间件软件的适配需要时间。
stackoverflow里“Tomcat support for HTTP/2.0?”,jetty的源码码作者做了如下的总结:
I‘m the HTTP/2 implementer in Jetty, and I watch out other projects implementing HTTP/2.Tomcat‘s Mark Thomas has outlined support for HTTP/2 for Tomcat 9.
Considering that Servlet 4.0 is going to have as a target HTTP/2 support, and that HTTP/2 support requires ALPN support in the JDK (which also I am involved in), and that ALPN support in the JDK is scheduled for JDK 9, it is probably going to be a long time before all that materializes.However, be aware that other Servlet Containers already provide HTTP/2 support.
Jetty 9.3.0 has full, robust, support for HTTP/2, client and server. We have been running HTTP/2 on our own website for many months now, and we consider HTTP/2 support production ready.
Jetty‘s HTTP/2 Push APIs are being considered for inclusion in Servlet 4.0. HTTP/2 Push is already available to applications deployed to Jetty in a transparent way (via a Servlet Filter).
Undertow also has an implementation for HTTP/2.
Netty also has one, but it‘s not based on the Servlet APIs.
可以看到,其实很多的中间件厂商都已经准备和JDK(主要是servlet标准)绑定发布了。
开源中国上有一则tomcat9的发布公告:
Apache Tomcat 9.0.0.M1 是 9.0.x 的第一个里程碑版本,提供 9.0.x 的新特性早期预览,希望能得到用户的反馈。
值得关注的改进:
- 新增 HTTP/2 支持和 TLS 虚拟主机
- 实现当前 Servlet 4.0 规范草案
- BIO connectors 不再支持 Windows Itanium 和 Comet
comet取消,因为http2.0 加入了 server push的功能。
SPDY vs HTTP2.0
http 2.0 也参考自google的SPDY。虽然SPDY并未成为标准,但是作为一种兼容http协议,并且是高性能和安全的的http访问方案,也曾在国内的厂商中使用:
作为下一代http协议,HTTPS、SPDY和HTTP/2的性能比较
在SPDY和HTTP/2中都用到的多路复用技术,可以参考这个demo。可以这么考虑,就是http基于文本的传输方式太慢,我们希望能够采用tcp传输层中一些经验,来优化,当然第一步就是把http打包成二进制。
HTTP2.0那些事这篇文章,极为详细地从SPDY分析到HTTP2.0的诞生。
HTTP vs HTTPS
基于安全的原因,很多公司都把网站换成了https,但是https是需要ca机构签发证书的,否则像chrome这些浏览器会进行安全提示的。
但是网站换成了https之后,会不会影响百度的收录呢?
参考这篇站点切换https不会对流量产生负面影响。答案是基本不会,如果原来是http,做了映射到 https,状态码是 301或302就没有问题。
以上是关于HTTP 2.0 与 tomcat的主要内容,如果未能解决你的问题,请参考以下文章