How can I enable keep-alive?

后端 未结 6 1086
醉酒成梦
醉酒成梦 2020-12-28 13:21

I ran a Google Page Speed and it says I scored 57/100 because I need to \"Enable Keep-Alive\" and \"Enable Compression\". I did some Google searches but I c

6条回答
  •  被撕碎了的回忆
    2020-12-28 14:01

    When you have "keep-alive" enabled you tell the browser of your user to use one TCP/IP connection for all the files(images, scripts,etc.) your website loads instead of using a TCP/IP connection for every single file. So it keeps a single connection "alive" to retrieve all the website files at once. This is much faster as using a multitude of connections. There are various ways to enable keep-alive. You can enable it by

    • Using/Editing the .htaccess file
    • Enabling it through access to your web server(Apache, Windows server, etc.)

    Go here for more detailed information about this.

    With the "Enable Compression" part they mean you should enable GZIP compression (if your web host hasn't already enabled it, as it's pretty much the default nowadays). The GZIP compression technique makes it possible for your web files to be compressed before they're being sent to your users browser. This means your user has to download much smaller files to fully load your web pages.

提交回复
热议问题