V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
baskice
V2EX  ›  问与答

HTTPS 能不能做长连接吗?

  •  
  •   baskice · 2017-05-20 11:12:37 +08:00 · 3902 次点击
    这是一个创建于 2541 天前的主题,其中的信息可能已经有所发展或是发生改变。
    刚才用某大陆产网站性能分析软件测性能。里面所有 https 项的 长连接 处都打 X

    HTTPS 能不能做长连接吗?
    8 条回复    2017-05-22 18:42:28 +08:00
    chaim
        1
    chaim  
       2017-05-20 11:39:29 +08:00
    可以看下 http2
    hilyjiang
        2
    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
        3
    changwei  
       2017-05-20 12:04:17 +08:00 via Android
    我知道 websocket 可以用 ssl,wss,不知道算不算长链接
    AnonymousAccout
        4
    AnonymousAccout  
       2017-05-20 13:10:46 +08:00 via iPhone   ❤️ 5
    题外话:请原谅我这位强迫症患者
    HTTPS 能不能做长连接吗?✘
    HTTPS 能做长连接吗?✔
    HTTPS 能不能做长连接?✔
    hilyjiang
        5
    hilyjiang  
       2017-05-20 13:52:28 +08:00 via Android   ❤️ 5
    @AnonymousAccout
    请原谅我这位强迫症患者
    Accout ✘
    Account ✔
    nfroot
        6
    nfroot  
       2017-05-20 13:57:11 +08:00
    @hilyjiang 估计他就是注册不到那个才减少字符的 虽然这样更坑爹
    AnonymousAccout
        7
    AnonymousAccout  
       2017-05-20 14:18:36 +08:00 via iPhone
    @hilyjiang
    @nfroot 强迫症为何为难强迫症 😂
    Williamp
        8
    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
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   748 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 21:19 · PVG 05:19 · LAX 14:19 · JFK 17:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.