HTTPS 能不能做长连接吗?

2017-05-20 11:12:37 +08:00
 baskice
刚才用某大陆产网站性能分析软件测性能。里面所有 https 项的 长连接 处都打 X

HTTPS 能不能做长连接吗?
3920 次点击
所在节点    问与答
8 条回复
chaim
2017-05-20 11:39:29 +08:00
可以看下 http2
hilyjiang
2017-05-20 12:01:27 +08:00
支持的,不然 HTTP 头里的 Connection: Keep-alive 就没有意义了。

可以参考 Nginx 配置实现中的介绍:
http://nginx.org/en/docs/http/ngx_http_ssl_module.html

To reduce the processor load it is recommended to
* set the number of worker processes equal to the number of processors,
* enable keep-alive connections,
* enable the shared session cache,
* disable the built-in session cache,
* and possibly increase the session lifetime (by default, 5 minutes)

第 2 点就是建议你开启长连接,减少处理器开销。
changwei
2017-05-20 12:04:17 +08:00
我知道 websocket 可以用 ssl,wss,不知道算不算长链接
AnonymousAccout
2017-05-20 13:10:46 +08:00
题外话:请原谅我这位强迫症患者
HTTPS 能不能做长连接吗?✘
HTTPS 能做长连接吗?✔
HTTPS 能不能做长连接?✔
hilyjiang
2017-05-20 13:52:28 +08:00
@AnonymousAccout
请原谅我这位强迫症患者
Accout ✘
Account ✔
nfroot
2017-05-20 13:57:11 +08:00
@hilyjiang 估计他就是注册不到那个才减少字符的 虽然这样更坑爹
AnonymousAccout
2017-05-20 14:18:36 +08:00
@hilyjiang
@nfroot 强迫症为何为难强迫症 😂
Williamp
2017-05-22 18:42:28 +08:00
You should apply HTTP/2 for your website for the faster connection. Read more from here https://www.v2ex.com/t/350927#reply13

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/362606

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX