V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
baskice
V2EX  ›  问与答

HTTPS 能不能做长连接吗?

  •  
  •   baskice · May 20, 2017 · 4384 views
    This topic created in 3278 days ago, the information mentioned may be changed or developed.
    刚才用某大陆产网站性能分析软件测性能。里面所有 https 项的 长连接 处都打 X

    HTTPS 能不能做长连接吗?
    8 replies    2017-05-22 18:42:28 +08:00
    chaim
        1
    chaim  
       May 20, 2017
    可以看下 http2
    hilyjiang
        2
    hilyjiang  
       May 20, 2017
    支持的,不然 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  
       May 20, 2017 via Android
    我知道 websocket 可以用 ssl,wss,不知道算不算长链接
    AnonymousAccout
        4
    AnonymousAccout  
       May 20, 2017 via iPhone   ❤️ 5
    题外话:请原谅我这位强迫症患者
    HTTPS 能不能做长连接吗?✘
    HTTPS 能做长连接吗?✔
    HTTPS 能不能做长连接?✔
    hilyjiang
        5
    hilyjiang  
       May 20, 2017 via Android   ❤️ 5
    @AnonymousAccout
    请原谅我这位强迫症患者
    Accout ✘
    Account ✔
    nfroot
        6
    nfroot  
       May 20, 2017
    @hilyjiang 估计他就是注册不到那个才减少字符的 虽然这样更坑爹
    AnonymousAccout
        7
    AnonymousAccout  
       May 20, 2017 via iPhone
    @hilyjiang
    @nfroot 强迫症为何为难强迫症 😂
    Williamp
        8
    Williamp  
       May 22, 2017
    You should apply HTTP/2 for your website for the faster connection. Read more from here https://www.v2ex.com/t/350927#reply13
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4049 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 65ms · UTC 04:19 · PVG 12:19 · LAX 21:19 · JFK 00:19
    ♥ Do have faith in what you're doing.