Enable Keep-Alive (Page Speed)

Dominicanstan picture Dominicanstan · Nov 22, 2011 · Viewed 16.3k times · Source

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

Answer

jmkeyes picture jmkeyes · Nov 22, 2011

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.