Enable Keep-Alive (Page Speed)

16,509

Solution 1

HTTP Keep-Alive (otherwise known as HTTP persistent connections) configures the HTTP server to hold open a connection so that it can be reused by the client to send multiple requests thus reducing the overhead of loading a page. Each server and environment are different, so setting it up depends on your environment.

In short: if you're using HTTP/1.0, when making the original request (assuming your server supports it) add a Connection: Keep-Alive header. If the server supports it, it will return the same header back to you. If you're using HTTP/1.1 and the server is configured properly, it will automatically use persistent connections.

Solution 2

Be aware that while Keep-Alive provides some benefit at low volumes, it performs poorly at high volumes for small and medium-size sites (for example, if your blog gets Slashdotted). This Hacker News thread has some good background information.

In other words, while many of the PageSpeed recommendations are great across the board, this one should be taken with a grain of salt.

Share:
16,509
Dominicanstan
Author by

Dominicanstan

Updated on June 05, 2022

Comments

  • Dominicanstan
    Dominicanstan almost 2 years

    What is the keep-alive feature? How can I enable it?

    Following is the output from the chrome's Page Speed plugin.

    Enable Keep-Alive The host {MYWEBSITE.COM} should enable Keep-Alive. It serves the following resources.

    http://MYWEBSITE.com/
    http://MYWEBSITE.com/fonts/AGENCYR.TTF
    http://MYWEBSITE.com/images/big_mini/0002_mini.jpeg
    http://MYWEBSITE.com/images/big_mini/0003_mini.jpeg
    http://MYWEBSITE.com/images/big_mini/0004_mini.jpeg
    http://MYWEBSITE.com/images/big_mini/0005_mini.jpeg
    http://MYWEBSITE.com/images/big_mini/0006_mini.jpeg
    http://MYWEBSITE.com/images/big_mini/0007_mini.jpeg
    http://MYWEBSITE.com/images/.jpeg
    http://MYWEBSITE.com/images/small/0002S.jpeg
    http://MYWEBSITE.com/images/small/0003S.jpeg
    http://MYWEBSITE.com/images/small/0004S.jpeg
    http://MYWEBSITE.com/images/small/0005S.jpeg
    http://MYWEBSITE.com/images/small/0006S.jpeg
    http://MYWEBSITE.com/images/small/0007S.jpeg
    http://MYWEBSITE.com/images/small/0008S.jpeg
    http://MYWEBSITE.com/images/small/0009S.jpeg
    http://MYWEBSITE.com/images/small/0010S.jpeg
    http://MYWEBSITE.com/images/small/0011S.jpeg
    http://MYWEBSITE.com/images/small/0012S.jpg
    http://MYWEBSITE.com/images/small/0013S.jpeg
    http://MYWEBSITE.com/images/small/0014S.jpeg
    http://MYWEBSITE.com/images/small/0015S.jpeg
    http://MYWEBSITE.com/images/small/0016S.jpeg
    http://MYWEBSITE.com/images/small/0017S.jpeg
    http://MYWEBSITE.com/images/small/0018S.jpeg
    http://MYWEBSITE.com/images/small/0019S.jpeg
    http://MYWEBSITE.com/yoxview/yoxview.css
    http://MYWEBSITE.com/yoxview/images/empty.gif
    http://MYWEBSITE.com/yoxview/images/left.png
    http://MYWEBSITE.com/yoxview/images/popup_ajax_loader.gif
    http://MYWEBSITE.com/yoxview/images/right.png
    http://MYWEBSITE.com/yoxview/images/sprites.png
    http://MYWEBSITE.com/yoxview/img3_mini.jpeg
    http://MYWEBSITE.com/yoxview/jquery.yoxview-2.21.min.js
    http://MYWEBSITE.com/yoxview/lang/en.js
    http://MYWEBSITE.com/yoxview/yoxview-init.js
    
  • Simon Dragsbæk
    Simon Dragsbæk about 11 years
    Is it a server fix? markup fix where to set this in the header??